Add archiveSiblingSessions
// FREEBIE
This commit is contained in:
parent
982e7f962c
commit
e5e4eab9c5
1 changed files with 12 additions and 0 deletions
|
@ -338,6 +338,18 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
archiveSiblingSessions: function(identifier) {
|
||||||
|
var address = libsignal.SignalProtocolAddress.fromString(identifier);
|
||||||
|
return this.getDeviceIds(address.getName()).then(function(deviceIds) {
|
||||||
|
var deviceIds = _.without(deviceIds, address.getDeviceId());
|
||||||
|
return Promise.all(deviceIds.map(function(deviceId) {
|
||||||
|
var sibling = new libsignal.SignalProtocolAddress(address.getName(), deviceId);
|
||||||
|
console.log('closing session for', sibling.toString());
|
||||||
|
var sessionCipher = new libsignal.SessionCipher(textsecure.storage.protocol, sibling);
|
||||||
|
return sessionCipher.closeOpenSessionForDevice();
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
},
|
||||||
archiveAllSessions: function(number) {
|
archiveAllSessions: function(number) {
|
||||||
return this.getDeviceIds(number).then(function(deviceIds) {
|
return this.getDeviceIds(number).then(function(deviceIds) {
|
||||||
return Promise.all(deviceIds.map(function(deviceId) {
|
return Promise.all(deviceIds.map(function(deviceId) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue