Prevent prekeys to be deleted when re-sending pairing request

This commit is contained in:
sachaaaaa 2019-11-20 12:27:07 +11:00
parent 6cb68d2fc6
commit 3d7548729f

View file

@ -444,12 +444,18 @@
window.log.info('clearing all sessions, prekeys, and signed prekeys'); window.log.info('clearing all sessions, prekeys, and signed prekeys');
await Promise.all([ await Promise.all([
store.clearPreKeyStore(),
store.clearContactPreKeysStore(), store.clearContactPreKeysStore(),
store.clearSignedPreKeysStore(),
store.clearContactSignedPreKeysStore(), store.clearContactSignedPreKeysStore(),
store.clearSessionStore(), store.clearSessionStore(),
]); ]);
// During secondary device registration we need to keep our prekeys sent
// to other pubkeys
if (textsecure.storage.get('secondaryDeviceStatus') !== 'ongoing') {
await Promise.all([
store.clearPreKeyStore(),
store.clearSignedPreKeysStore(),
]);
}
}, },
// Takes the same object returned by generateKeys // Takes the same object returned by generateKeys
async confirmKeys(keys) { async confirmKeys(keys) {