summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_list.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-10-05 11:48:10 -0400
committerJoram Wilander <jwawilander@gmail.com>2015-10-05 11:48:10 -0400
commitb591c4b32ee7cb5ea54738f9cb2bcb95b9583496 (patch)
treed5494bbc684888994531fd433f6b78b62fb0080a /web/react/components/post_list.jsx
parent5d3649b5a478766261832e83236d7cb80e490f8b (diff)
parentef55d7f244cb727402a7c0a570efd719e794cf66 (diff)
downloadchat-b591c4b32ee7cb5ea54738f9cb2bcb95b9583496.tar.gz
chat-b591c4b32ee7cb5ea54738f9cb2bcb95b9583496.tar.bz2
chat-b591c4b32ee7cb5ea54738f9cb2bcb95b9583496.zip
Merge pull request #914 from mattermost/plt-297
PLT-297 Add ability to override username and icon for posts from incoming webhooks.
Diffstat (limited to 'web/react/components/post_list.jsx')
-rw-r--r--web/react/components/post_list.jsx15
1 files changed, 13 insertions, 2 deletions
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index a31967257..b90197ac4 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -516,8 +516,19 @@ export default class PostList extends React.Component {
sameRoot = utils.isComment(post) && (prevPost.id === post.root_id || prevPost.root_id === post.root_id);
- // we only hide the profile pic if the previous post is not a comment, the current post is not a comment, and the previous post was made by the same user as the current post
- hideProfilePic = (prevPost.user_id === post.user_id) && !utils.isComment(prevPost) && !utils.isComment(post);
+ // hide the profile pic if:
+ // the previous post was made by the same user as the current post,
+ // the previous post is not a comment,
+ // the current post is not a comment,
+ // the current post is not from a webhook
+ // and the previous post is not from a webhook
+ if ((prevPost.user_id === post.user_id) &&
+ !utils.isComment(prevPost) &&
+ !utils.isComment(post) &&
+ (!post.props || !post.props.from_webhook) &&
+ (!prevPost.props || !prevPost.props.from_webhook)) {
+ hideProfilePic = true;
+ }
}
// check if it's the last comment in a consecutive string of comments on the same post