From df3b62c6c09ab6f8f20d7d66383f0ad86c8fb167 Mon Sep 17 00:00:00 2001 From: Cori Hudson Date: Wed, 8 Jan 2020 13:59:02 -0500 Subject: [PATCH] fix: add logic for authorIsBot in adhoc teams --- shared/chat/conversation/messages/wrapper/container.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/chat/conversation/messages/wrapper/container.tsx b/shared/chat/conversation/messages/wrapper/container.tsx index 33250f93dee6..19b71896122d 100644 --- a/shared/chat/conversation/messages/wrapper/container.tsx +++ b/shared/chat/conversation/messages/wrapper/container.tsx @@ -118,6 +118,7 @@ const getDecorate = (message: Types.Message) => { export default Container.namedConnect( (state: Container.TypedState, ownProps: OwnProps) => { + const _participantInfo = Constants.getParticipantInfo(state, ownProps.conversationIDKey) const message = Constants.getMessage(state, ownProps.conversationIDKey, ownProps.ordinal) || missingMessage const previous = @@ -145,7 +146,7 @@ export default Container.namedConnect( const authorIsBot = teamname ? TeamConstants.userIsRoleInTeam(state, teamname, message.author, 'restrictedbot') || TeamConstants.userIsRoleInTeam(state, teamname, message.author, 'bot') - : false + : !_participantInfo.name.includes(message.author) // if adhoc, check if author in participants const authorIsOwner = teamname ? TeamConstants.userIsRoleInTeam(state, teamname, message.author, 'owner') : false