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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 1572 additions and 447 deletions

View file

@ -36,7 +36,7 @@ export function isQuoteAMatch(
}
const { authorUuid, id } = quote;
const authorConversationId = window.ConversationController.ensureContactIds({
const authorConversation = window.ConversationController.lookupOrCreate({
e164: 'author' in quote ? quote.author : undefined,
uuid: authorUuid,
});
@ -44,7 +44,7 @@ export function isQuoteAMatch(
return (
message.sent_at === id &&
message.conversationId === conversationId &&
getContactId(message) === authorConversationId
getContactId(message) === authorConversation?.id
);
}
@ -58,10 +58,11 @@ export function getContactId(
return window.ConversationController.getOurConversationId();
}
return window.ConversationController.ensureContactIds({
const conversation = window.ConversationController.lookupOrCreate({
e164: source,
uuid: sourceUuid,
});
return conversation?.id;
}
export function getContact(