Archive sessions on key changes after profile fetch

// FREEBIE
This commit is contained in:
lilia 2017-06-19 12:26:00 -07:00 committed by Scott Nonnenberg
parent 4232f5711c
commit 3acfda3a56
2 changed files with 16 additions and 2 deletions

View file

@ -338,6 +338,16 @@
});
});
},
archiveAllSessions: function(number) {
return this.getDeviceIds(number).then(function(deviceIds) {
return Promise.all(deviceIds.map(function(deviceId) {
var address = new libsignal.SignalProtocolAddress(number, deviceId);
console.log('closing session for', address.toString());
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, address);
return sessionCipher.closeOpenSessionForDevice();
}));
});
},
clearSessionStore: function() {
return new Promise(function(resolve) {
var sessions = new SessionCollection();