Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-15324 Allow plugins override ephemeral posts #2759

Merged
merged 5 commits into from
May 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion components/post_view/post_body/post_body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ export default class PostBody extends React.PureComponent {
</React.Fragment>
);

const hasPlugin = post.type && this.props.pluginPostTypes.hasOwnProperty(post.type);
const hasPlugin = (post.type && this.props.pluginPostTypes.hasOwnProperty(post.type)) ||
(post.props && post.props.type && this.props.pluginPostTypes.hasOwnProperty(post.props.type));

let messageWithAdditionalContent;
if (this.props.post.state === Posts.POST_DELETED || hasPlugin) {
Expand Down
3 changes: 2 additions & 1 deletion components/post_view/post_message_view/post_message_view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ export default class PostMessageView extends React.PureComponent {
return <span>{post.message}</span>;
}

const postType = post.type;
const postType = post.props && post.props.type ? post.props.type : post.type;

if (pluginPostTypes.hasOwnProperty(postType)) {
const PluginComponent = pluginPostTypes[postType].component;
return (
Expand Down