Refine sealed sender logic
This commit is contained in:
parent
f11dd18536
commit
e2e0e4c96b
3 changed files with 156 additions and 98 deletions
|
@ -1121,9 +1121,11 @@
|
|||
|
||||
// Sent:
|
||||
async function handleMessageSentProfileUpdate({
|
||||
data,
|
||||
confirm,
|
||||
messageDescriptor,
|
||||
}) {
|
||||
// First set profileSharing = true for the conversation we sent to
|
||||
const { id, type } = messageDescriptor;
|
||||
const conversation = await ConversationController.getOrCreateAndWait(
|
||||
id,
|
||||
|
@ -1135,6 +1137,14 @@
|
|||
Conversation: Whisper.Conversation,
|
||||
});
|
||||
|
||||
// Then we update our own profileKey if it's different from what we have
|
||||
const ourNumber = textsecure.storage.user.getNumber();
|
||||
const profileKey = data.message.profileKey.toString('base64');
|
||||
const me = await ConversationController.getOrCreate(ourNumber, 'private');
|
||||
|
||||
// Will do the save for us if needed
|
||||
await me.setProfileKey(profileKey);
|
||||
|
||||
return confirm();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue