From 702489ca58de0aa53263119cacc852256ba99b80 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Tue, 8 Dec 2015 09:10:52 -0500 Subject: Fix username on commented on message for webhooks --- web/react/components/post_body.jsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'web/react') 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 = ( - {profile.username} + {username} ); } -- cgit v1.2.3-1-g7c22