Early preparations for PNP Contact Merging

This commit is contained in:
Scott Nonnenberg
2022-08-09 14:39:00 -07:00
committed by GitHub
parent 2f5dd73e58
commit faf6c41332
30 changed files with 1572 additions and 447 deletions

View File

@@ -1045,11 +1045,11 @@ export class SignalProtocolStore extends EventsMixin {
}
const { uuid, deviceId } = qualifiedAddress;
const conversationId = window.ConversationController.ensureContactIds({
const conversation = window.ConversationController.lookupOrCreate({
uuid: uuid.toString(),
});
strictAssert(
conversationId !== undefined,
conversation !== undefined,
'storeSession: Ensure contact ids failed'
);
const id = qualifiedAddress.toString();
@@ -1059,7 +1059,7 @@ export class SignalProtocolStore extends EventsMixin {
id,
version: 2,
ourUuid: qualifiedAddress.ourUuid.toString(),
conversationId,
conversationId: conversation.id,
uuid: uuid.toString(),
deviceId,
record: record.serialize().toString('base64'),
@@ -1376,12 +1376,9 @@ export class SignalProtocolStore extends EventsMixin {
const { uuid } = qualifiedAddress;
// First, fetch this conversation
const conversationId = window.ConversationController.ensureContactIds({
const conversation = window.ConversationController.lookupOrCreate({
uuid: uuid.toString(),
});
assert(conversationId, `lightSessionReset/${id}: missing conversationId`);
const conversation = window.ConversationController.get(conversationId);
assert(conversation, `lightSessionReset/${id}: missing conversation`);
log.warn(`lightSessionReset/${id}: Resetting session`);