diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/post_body.jsx | 14 | ||||
-rw-r--r-- | web/react/stores/socket_store.jsx | 1 |
2 files changed, 12 insertions, 3 deletions
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx index 296b9e7d7..35a7727e9 100644 --- a/web/react/components/post_body.jsx +++ b/web/react/components/post_body.jsx @@ -309,7 +309,15 @@ export default class PostBody extends React.Component { let apostrophe = ''; let name = '...'; if (profile != null) { - if (profile.username.slice(-1) === 's') { + let username = profile.username; + if (parentPost.props && + parentPost.props.from_webhook && + parentPost.props.override_username && + global.window.mm_config.EnablePostUsernameOverride === 'true') { + username = parentPost.props.override_username; + } + + if (username.slice(-1) === 's') { apostrophe = '\''; } else { apostrophe = '\'s'; @@ -317,9 +325,9 @@ export default class PostBody extends React.Component { name = ( <a className='theme' - onClick={Utils.searchForTerm.bind(null, profile.username)} + onClick={Utils.searchForTerm.bind(null, username)} > - {profile.username} + {username} </a> ); } diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx index c8e3c8bdd..d5aed40cf 100644 --- a/web/react/stores/socket_store.jsx +++ b/web/react/stores/socket_store.jsx @@ -225,6 +225,7 @@ function handlePostEditEvent(msg) { // Store post const post = JSON.parse(msg.props.post); PostStore.storePost(post); + PostStore.emitChange(); // Update channel state if (ChannelStore.getCurrentId() === msg.channel_id) { |