processVerifiedMessage: Archive all sessions when key changes
FREEBIE
This commit is contained in:
parent
827addf628
commit
7bfb66b13b
2 changed files with 10 additions and 7 deletions
|
@ -111,13 +111,13 @@
|
||||||
}.bind(this)).then(function() {
|
}.bind(this)).then(function() {
|
||||||
this.addVerifiedChange(this.id, verified === VERIFIED, {local: !options.viaSyncMessage});
|
this.addVerifiedChange(this.id, verified === VERIFIED, {local: !options.viaSyncMessage});
|
||||||
if (!options.viaSyncMessage) {
|
if (!options.viaSyncMessage) {
|
||||||
this.sendVerifySyncMessage(this.id, verified);
|
return this.sendVerifySyncMessage(this.id, verified);
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
sendVerifySyncMessage: function(number, state) {
|
sendVerifySyncMessage: function(number, state) {
|
||||||
textsecure.storage.protocol.loadIdentityKey(number).then(function(key) {
|
textsecure.storage.protocol.loadIdentityKey(number).then(function(key) {
|
||||||
textsecure.messaging.syncVerification(number, state, key);
|
return textsecure.messaging.syncVerification(number, state, key);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
isVerified: function() {
|
isVerified: function() {
|
||||||
|
|
|
@ -606,17 +606,20 @@
|
||||||
|| (isPresent && !isEqual)
|
|| (isPresent && !isEqual)
|
||||||
|| (isPresent && identityRecord.get('verified') !== VerifiedStatus.VERIFIED))) {
|
|| (isPresent && identityRecord.get('verified') !== VerifiedStatus.VERIFIED))) {
|
||||||
|
|
||||||
if (!isPresent || !isEqual) {
|
|
||||||
this.trigger('keychange', identifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
textsecure.storage.protocol.saveIdentityWithAttributes(identifier, {
|
textsecure.storage.protocol.saveIdentityWithAttributes(identifier, {
|
||||||
publicKey : publicKey,
|
publicKey : publicKey,
|
||||||
verified : verifiedStatus,
|
verified : verifiedStatus,
|
||||||
firstUse : false,
|
firstUse : false,
|
||||||
timestamp : Date.now(),
|
timestamp : Date.now(),
|
||||||
nonblockingApproval : true
|
nonblockingApproval : true
|
||||||
}).then(resolve, reject);
|
}).then(function() {
|
||||||
|
if (!isPresent || !isEqual) {
|
||||||
|
this.trigger('keychange', identifier);
|
||||||
|
return this.archiveAllSessions(identifier).then(resolve, reject);
|
||||||
|
}
|
||||||
|
|
||||||
|
return resolve();
|
||||||
|
}.bind(this), reject);
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue