Include sender keys in SignalProtocolStore zones
This commit is contained in:
parent
a17e157e7b
commit
06165cb742
10 changed files with 231 additions and 108 deletions
|
@ -182,7 +182,7 @@ const dataInterface: ServerInterface = {
|
|||
|
||||
createOrUpdateSession,
|
||||
createOrUpdateSessions,
|
||||
commitSessionsAndUnprocessed,
|
||||
commitDecryptResult,
|
||||
bulkAddSessions,
|
||||
removeSessionById,
|
||||
removeSessionsByConversation,
|
||||
|
@ -757,6 +757,10 @@ async function removeAllItems(): Promise<void> {
|
|||
}
|
||||
|
||||
async function createOrUpdateSenderKey(key: SenderKeyType): Promise<void> {
|
||||
createOrUpdateSenderKeySync(key);
|
||||
}
|
||||
|
||||
function createOrUpdateSenderKeySync(key: SenderKeyType): void {
|
||||
const db = getInstance();
|
||||
|
||||
prepare(
|
||||
|
@ -1175,16 +1179,22 @@ async function createOrUpdateSessions(
|
|||
})();
|
||||
}
|
||||
|
||||
async function commitSessionsAndUnprocessed({
|
||||
async function commitDecryptResult({
|
||||
senderKeys,
|
||||
sessions,
|
||||
unprocessed,
|
||||
}: {
|
||||
senderKeys: Array<SenderKeyType>;
|
||||
sessions: Array<SessionType>;
|
||||
unprocessed: Array<UnprocessedType>;
|
||||
}): Promise<void> {
|
||||
const db = getInstance();
|
||||
|
||||
db.transaction(() => {
|
||||
for (const item of senderKeys) {
|
||||
assertSync(createOrUpdateSenderKeySync(item));
|
||||
}
|
||||
|
||||
for (const item of sessions) {
|
||||
assertSync(createOrUpdateSessionSync(item));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue