Skip to content

Commit

Permalink
suppress channel name msg for #general (#20200)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblum committed Oct 8, 2019
1 parent 69e9105 commit 9c21799
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 7 additions & 5 deletions shared/chat/conversation/messages/set-channelname/index.tsx
Expand Up @@ -7,11 +7,13 @@ type Props = {
message: Types.MessageSetChannelname
}

export default (props: Props) => (
<Kb.Text type="BodySmall" style={styles.text} selectable={true}>
set the channel name to <Kb.Text type="BodySmallItalic">#{props.message.newChannelname}</Kb.Text>
</Kb.Text>
)
export default (props: Props) =>
// suppress this message for the #general channel, it is redundant.
props.message.newChannelname === 'general' ? null : (
<Kb.Text type="BodySmall" style={styles.text} selectable={true}>
set the channel name to <Kb.Text type="BodySmallItalic">#{props.message.newChannelname}</Kb.Text>
</Kb.Text>
)

const styles = Styles.styleSheetCreate(
() =>
Expand Down
6 changes: 5 additions & 1 deletion shared/chat/conversation/messages/wrapper/container.tsx
Expand Up @@ -42,8 +42,12 @@ const getUsernameToShow = (
case 'requestPayment':
case 'sendPayment':
case 'text':
case 'setChannelname':
return !previous || !sequentialUserMessages || !!timestamp ? message.author : ''
case 'setChannelname':
// suppress this message for the #general channel, it is redundant.
return (!previous || !sequentialUserMessages || !!timestamp) && message.newChannelname !== 'general'
? message.author
: ''
case 'systemAddedToTeam':
return message.addee === you ? '' : message.addee
case 'systemLeft':
Expand Down

0 comments on commit 9c21799

Please sign in to comment.