mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Improve safety number logic in group conversations
This commit is contained in:
@@ -198,10 +198,13 @@
|
||||
|
||||
return { wrap, sendOptions };
|
||||
},
|
||||
async getAllGroupsInvolvingId(id) {
|
||||
const groups = await window.Signal.Data.getAllGroupsInvolvingId(id, {
|
||||
ConversationCollection: Whisper.ConversationCollection,
|
||||
});
|
||||
async getAllGroupsInvolvingId(conversationId) {
|
||||
const groups = await window.Signal.Data.getAllGroupsInvolvingId(
|
||||
conversationId,
|
||||
{
|
||||
ConversationCollection: Whisper.ConversationCollection,
|
||||
}
|
||||
);
|
||||
return groups.map(group => conversations.add(group));
|
||||
},
|
||||
loadPromise() {
|
||||
|
||||
@@ -14,16 +14,18 @@
|
||||
throw new Error('KeyChangeListener requires a SignalProtocolStore');
|
||||
}
|
||||
|
||||
signalProtocolStore.on('keychange', async id => {
|
||||
signalProtocolStore.on('keychange', async identifier => {
|
||||
const conversation = await ConversationController.getOrCreateAndWait(
|
||||
id,
|
||||
identifier,
|
||||
'private'
|
||||
);
|
||||
conversation.addKeyChange(id);
|
||||
conversation.addKeyChange(identifier);
|
||||
|
||||
const groups = await ConversationController.getAllGroupsInvolvingId(id);
|
||||
const groups = await ConversationController.getAllGroupsInvolvingId(
|
||||
conversation.id
|
||||
);
|
||||
_.forEach(groups, group => {
|
||||
group.addKeyChange(id);
|
||||
group.addKeyChange(identifier);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user