diff options
Diffstat (limited to 'webapp/utils')
-rw-r--r-- | webapp/utils/utils.jsx | 15 |
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; +} |