Don't show name collisions for system contacts

This commit is contained in:
Evan Hahn 2021-06-02 12:24:22 -05:00 committed by GitHub
parent 84be8288e9
commit 6c6eed0b1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 121 additions and 17 deletions

View file

@ -6,6 +6,7 @@ import { SendMetadataType, SendOptionsType } from '../textsecure/SendMessage';
import { arrayBufferToBase64, getRandomBytes } from '../Crypto';
import { getConversationMembers } from './getConversationMembers';
import { isDirectConversation, isMe } from './whatTypeOfConversation';
import { isInSystemContacts } from './isInSystemContacts';
import { missingCaseError } from './missingCaseError';
import { senderCertificateService } from '../services/senderCertificate';
import {
@ -117,13 +118,11 @@ function getSenderCertificateForDirectConversation(
case PhoneNumberSharingMode.Everybody:
certificateMode = SenderCertificateMode.WithE164;
break;
case PhoneNumberSharingMode.ContactsOnly: {
const isInSystemContacts = Boolean(conversationAttrs.name);
certificateMode = isInSystemContacts
case PhoneNumberSharingMode.ContactsOnly:
certificateMode = isInSystemContacts(conversationAttrs)
? SenderCertificateMode.WithE164
: SenderCertificateMode.WithoutE164;
break;
}
case PhoneNumberSharingMode.Nobody:
certificateMode = SenderCertificateMode.WithoutE164;
break;