Skip to content

Commit

Permalink
Do not show link previews for system messages (mattermost#1338)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilander authored and cpanato committed Jun 14, 2018
1 parent 702c87e commit 8911ee7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as CommonUtils from 'utils/commons.jsx';
import {PostTypes} from 'utils/constants.jsx';
import {useSafeUrl} from 'utils/url';
import * as Utils from 'utils/utils.jsx';
import {isSystemMessage} from 'utils/post_utils.jsx';

export default class PostAttachmentOpenGraph extends React.PureComponent {
static propTypes = {
Expand Down Expand Up @@ -258,7 +259,7 @@ export default class PostAttachmentOpenGraph extends React.PureComponent {

render() {
const data = this.props.openGraphData;
if (!data || !data.url || this.state.removePreview) {
if (!data || !data.url || this.state.removePreview || isSystemMessage(this.props.post || {})) {
return null;
}

Expand Down

0 comments on commit 8911ee7

Please sign in to comment.