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

@ -589,8 +589,12 @@
var identityKey = dcodeIO.ByteBuffer.wrap(profile.identityKey, 'base64').toArrayBuffer();
return textsecure.storage.protocol.saveIdentity(
id, identityKey, false
);
id, identityKey, false
).then(function(isIdentityChange) {
if (isIdentityChange) {
return textsecure.storage.protocol.archiveAllSessions(id);
}
});
});
},