summaryrefslogtreecommitdiffstats
path: root/webapp/utils/utils.jsx
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-04-01 11:53:49 -0400
committerJoramWilander <jwawilander@gmail.com>2016-04-04 08:30:11 -0400
commit0f3d62364b7efaa553c711f2a63852a09b34277c (patch)
tree1e04f5fbd081dc32025784ccc1e990a1507632b3 /webapp/utils/utils.jsx
parent785553384fe96027b0e9274b6ccc8623092eda70 (diff)
downloadchat-0f3d62364b7efaa553c711f2a63852a09b34277c.tar.gz
chat-0f3d62364b7efaa553c711f2a63852a09b34277c.tar.bz2
chat-0f3d62364b7efaa553c711f2a63852a09b34277c.zip
Properly display webhook username/icon in search results
Diffstat (limited to 'webapp/utils/utils.jsx')
-rw-r--r--webapp/utils/utils.jsx15
1 files changed, 15 insertions, 0 deletions
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index 9b03ef32a..3b7583f15 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -1379,3 +1379,18 @@ export function localizeMessage(id, defaultMessage) {
return id;
}
+
+export function getProfilePicSrcForPost(post, timestamp) {
+ let src = '/api/v1/users/' + post.user_id + '/image?time=' + timestamp;
+ if (post.props && post.props.from_webhook && global.window.mm_config.EnablePostIconOverride === 'true') {
+ if (post.props.override_icon_url) {
+ src = post.props.override_icon_url;
+ } else {
+ src = Constants.DEFAULT_WEBHOOK_LOGO;
+ }
+ } else if (isSystemMessage(post)) {
+ src = Constants.SYSTEM_MESSAGE_PROFILE_IMAGE;
+ }
+
+ return src;
+}