From 6c6eed0b1e1e95aeff120268289e5f071d727137 Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Wed, 2 Jun 2021 12:24:22 -0500 Subject: [PATCH] Don't show name collisions for system contacts --- ts/components/CallingParticipantsList.tsx | 3 +- ts/components/ContactListItem.tsx | 15 ++++-- ts/components/SafetyNumberChangeDialog.tsx | 3 +- .../ContactSpoofingReviewDialog.tsx | 3 +- .../conversation/ConversationHeader.tsx | 5 +- ts/state/selectors/conversations.ts | 5 +- .../util/groupMemberNameCollisions_test.ts | 29 ++++++++++++ ts/test-both/util/isInSystemContacts_test.ts | 46 +++++++++++++++++++ ts/util/getSendOptions.ts | 7 ++- ts/util/groupMemberNameCollisions.ts | 4 +- ts/util/isConversationAccepted.ts | 6 ++- ts/util/isInSystemContacts.ts | 12 +++++ 12 files changed, 121 insertions(+), 17 deletions(-) create mode 100644 ts/test-both/util/isInSystemContacts_test.ts create mode 100644 ts/util/isInSystemContacts.ts diff --git a/ts/components/CallingParticipantsList.tsx b/ts/components/CallingParticipantsList.tsx index f6f679fde..b3a124573 100644 --- a/ts/components/CallingParticipantsList.tsx +++ b/ts/components/CallingParticipantsList.tsx @@ -11,6 +11,7 @@ import { InContactsIcon } from './InContactsIcon'; import { LocalizerType } from '../types/Util'; import { sortByTitle } from '../util/sortByTitle'; import { ConversationType } from '../state/ducks/conversations'; +import { isInSystemContacts } from '../util/isInSystemContacts'; type ParticipantType = ConversationType & { hasRemoteAudio?: boolean; @@ -118,7 +119,7 @@ export const CallingParticipantsList = React.memo( module="module-calling-participants-list__name" title={participant.title} /> - {participant.name ? ( + {isInSystemContacts(participant) ? ( {' '} { } public render(): JSX.Element { - const { about, i18n, isAdmin, isMe, name, onClick, title } = this.props; + const { + about, + i18n, + isAdmin, + isMe, + name, + onClick, + title, + type, + } = this.props; const displayName = isMe ? i18n('you') : title; - const shouldShowIcon = Boolean(name); return ( ); - } else if (!conversationInfo.conversation.name) { + } else if (!isInSystemContacts(conversationInfo.conversation)) { button = (