diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-10-14 08:27:34 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-10-14 08:27:34 -0400 |
commit | cdbe6342bb018e16d6eb3f04c0c6c8457805e61a (patch) | |
tree | ce22f6283ab9e59cc6d14573eae547f38b009ad0 /web/react/components/rhs_root_post.jsx | |
parent | cbefd8895107c3f168c97c5676ad0b19c0254d10 (diff) | |
parent | 4ad9e0673ca8950597a290f10db10475b18b67cc (diff) | |
download | chat-cdbe6342bb018e16d6eb3f04c0c6c8457805e61a.tar.gz chat-cdbe6342bb018e16d6eb3f04c0c6c8457805e61a.tar.bz2 chat-cdbe6342bb018e16d6eb3f04c0c6c8457805e61a.zip |
Merge release branch 'release-1.1.0'
Diffstat (limited to 'web/react/components/rhs_root_post.jsx')
-rw-r--r-- | web/react/components/rhs_root_post.jsx | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/web/react/components/rhs_root_post.jsx b/web/react/components/rhs_root_post.jsx index c44844f34..442d3483e 100644 --- a/web/react/components/rhs_root_post.jsx +++ b/web/react/components/rhs_root_post.jsx @@ -117,20 +117,51 @@ export default class RhsRootPost extends React.Component { ); } + let userProfile = <UserProfile userId={post.user_id} />; + let botIndicator; + + if (post.props && post.props.from_webhook) { + if (post.props.override_username && global.window.config.EnablePostUsernameOverride === 'true') { + userProfile = ( + <UserProfile + userId={post.user_id} + overwriteName={post.props.override_username} + disablePopover={true} + /> + ); + } + + botIndicator = <li className='post-header-col post-header__name bot-indicator'>{'BOT'}</li>; + } + + let src = '/api/v1/users/' + post.user_id + '/image?time=' + timestamp; + if (post.props && post.props.from_webhook && global.window.config.EnablePostIconOverride === 'true') { + if (post.props.override_icon_url) { + src = post.props.override_icon_url; + } + } + + const profilePic = ( + <div className='post-profile-img__container'> + <img + className='post-profile-img' + src={src} + height='36' + width='36' + /> + </div> + ); + return ( <div className={'post post--root ' + currentUserCss}> <div className='post-right-channel__name'>{channelName}</div> <div className='post-profile-img__container'> - <img - className='post-profile-img' - src={'/api/v1/users/' + post.user_id + '/image?time=' + timestamp} - height='36' - width='36' - /> + {profilePic} </div> <div className='post__content'> <ul className='post-header'> - <li className='post-header-col'><strong><UserProfile userId={post.user_id} /></strong></li> + <li className='post-header-col'><strong>{userProfile}</strong></li> + {botIndicator} <li className='post-header-col'> <time className='post-profile-time'> {utils.displayCommentDateTime(post.create_at)} |