UUID-keyed lookups in SignalProtocolStore
This commit is contained in:
parent
6323aedd9b
commit
c7e7d55af4
46 changed files with 2094 additions and 1447 deletions
|
@ -1,34 +0,0 @@
|
|||
// Copyright 2017-2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
/* global Whisper, SignalProtocolStore, ConversationController, _ */
|
||||
|
||||
/* eslint-disable more/no-then */
|
||||
|
||||
// eslint-disable-next-line func-names
|
||||
(function () {
|
||||
window.Whisper = window.Whisper || {};
|
||||
|
||||
Whisper.KeyChangeListener = {
|
||||
init(signalProtocolStore) {
|
||||
if (!(signalProtocolStore instanceof SignalProtocolStore)) {
|
||||
throw new Error('KeyChangeListener requires a SignalProtocolStore');
|
||||
}
|
||||
|
||||
signalProtocolStore.on('keychange', async identifier => {
|
||||
const conversation = await ConversationController.getOrCreateAndWait(
|
||||
identifier,
|
||||
'private'
|
||||
);
|
||||
conversation.addKeyChange(identifier);
|
||||
|
||||
const groups = await ConversationController.getAllGroupsInvolvingId(
|
||||
conversation.id
|
||||
);
|
||||
_.forEach(groups, group => {
|
||||
group.addKeyChange(identifier);
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
})();
|
|
@ -142,6 +142,9 @@ const Errors = require('../../ts/types/errors');
|
|||
const MessageType = require('./types/message');
|
||||
const MIME = require('../../ts/types/MIME');
|
||||
const SettingsType = require('../../ts/types/Settings');
|
||||
const { UUID } = require('../../ts/types/UUID');
|
||||
const { Address } = require('../../ts/types/Address');
|
||||
const { QualifiedAddress } = require('../../ts/types/QualifiedAddress');
|
||||
|
||||
// Views
|
||||
const Initialization = require('./views/initialization');
|
||||
|
@ -430,6 +433,9 @@ exports.setup = (options = {}) => {
|
|||
MIME,
|
||||
Settings: SettingsType,
|
||||
VisualAttachment,
|
||||
UUID,
|
||||
Address,
|
||||
QualifiedAddress,
|
||||
};
|
||||
|
||||
const Views = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue