Early preparations for PNP Contact Merging
This commit is contained in:
parent
2f5dd73e58
commit
faf6c41332
30 changed files with 1572 additions and 447 deletions
|
@ -73,25 +73,24 @@ export async function lookupConversationWithoutUuid(
|
|||
const serverLookup = await messaging.getUuidsForE164s([options.e164]);
|
||||
|
||||
if (serverLookup[options.e164]) {
|
||||
conversationId = window.ConversationController.ensureContactIds({
|
||||
const convo = window.ConversationController.maybeMergeContacts({
|
||||
aci: serverLookup[options.e164] || undefined,
|
||||
e164: options.e164,
|
||||
uuid: serverLookup[options.e164],
|
||||
highTrust: true,
|
||||
reason: 'startNewConversationWithoutUuid(e164)',
|
||||
});
|
||||
conversationId = convo?.id;
|
||||
}
|
||||
} else {
|
||||
const foundUsername = await checkForUsername(options.username);
|
||||
if (foundUsername) {
|
||||
conversationId = window.ConversationController.ensureContactIds({
|
||||
const convo = window.ConversationController.lookupOrCreate({
|
||||
uuid: foundUsername.uuid,
|
||||
highTrust: true,
|
||||
reason: 'startNewConversationWithoutUuid(username)',
|
||||
});
|
||||
|
||||
const convo = window.ConversationController.get(conversationId);
|
||||
strictAssert(convo, 'We just ensured conversation existence');
|
||||
|
||||
conversationId = convo.id;
|
||||
|
||||
convo.set({ username: foundUsername.username });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue