Drop ContactRecords for our own ACI/PNI

This commit is contained in:
Fedor Indutny 2022-04-19 20:10:10 -07:00 committed by GitHub
parent e8d268b466
commit 7821a872bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,7 @@ import {
} from '../util/universalExpireTimer'; } from '../util/universalExpireTimer';
import { ourProfileKeyService } from './ourProfileKey'; import { ourProfileKeyService } from './ourProfileKey';
import { isGroupV1, isGroupV2 } from '../util/whatTypeOfConversation'; import { isGroupV1, isGroupV2 } from '../util/whatTypeOfConversation';
import { isValidUuid } from '../types/UUID'; import { isValidUuid, UUID, UUIDKind } from '../types/UUID';
import * as preferredReactionEmoji from '../reactions/preferredReactionEmoji'; import * as preferredReactionEmoji from '../reactions/preferredReactionEmoji';
import { SignalService as Proto } from '../protobuf'; import { SignalService as Proto } from '../protobuf';
import * as log from '../logging/log'; import * as log from '../logging/log';
@ -786,6 +786,10 @@ export async function mergeContactRecord(
return { hasConflict: false, shouldDrop: true, details: ['invalid uuid'] }; return { hasConflict: false, shouldDrop: true, details: ['invalid uuid'] };
} }
if (window.storage.user.getOurUuidKind(new UUID(uuid)) !== UUIDKind.Unknown) {
return { hasConflict: false, shouldDrop: true, details: ['our own uuid'] };
}
const id = window.ConversationController.ensureContactIds({ const id = window.ConversationController.ensureContactIds({
e164, e164,
uuid, uuid,