summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-12-08 08:41:30 -0800
committerCorey Hulen <corey@hulen.com>2015-12-08 08:41:30 -0800
commite2fc28b1f36f8be8a0631d78e21693fb3fd2947f (patch)
tree14fed9aa8907d1ccaa66d9c43e7a0f48bb58aeca
parentf449a4a0734a8f79da1b3c473675ffd0c810dc4c (diff)
parent702489ca58de0aa53263119cacc852256ba99b80 (diff)
downloadchat-e2fc28b1f36f8be8a0631d78e21693fb3fd2947f.tar.gz
chat-e2fc28b1f36f8be8a0631d78e21693fb3fd2947f.tar.bz2
chat-e2fc28b1f36f8be8a0631d78e21693fb3fd2947f.zip
Merge pull request #1651 from mattermost/plt-1399
PLT-1399 Fix username on commented on message for webhooks
-rw-r--r--web/react/components/post_body.jsx14
1 files changed, 11 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>
);
}