Account manager calls saveIdentityWithAtttributes
saveIdentityWithAtttributes allows directly setting all properties of an identity key record. In AccountManager we use it to save our own identity key after a new registration. Previously we would remove the existing key first in order to coerce firstUse to true, but now we can simply set it explicitly, along with a VERIFIED status. // FREEBIE
This commit is contained in:
parent
2a76bb6fc2
commit
261ec003ee
2 changed files with 16 additions and 8 deletions
|
@ -38122,10 +38122,14 @@ var TextSecureServer = (function() {
|
|||
|
||||
// update our own identity key, which may have changed
|
||||
// if we're relinking after a reinstall on the master device
|
||||
var putIdentity = textsecure.storage.protocol.saveIdentity.bind(
|
||||
null, number, identityKeyPair.pubKey, true, true
|
||||
);
|
||||
textsecure.storage.protocol.removeIdentityKey(number).then(putIdentity, putIdentity);
|
||||
textsecure.storage.protocol.saveIdentityWithAttributes({
|
||||
id : number,
|
||||
publicKey : identityKeyPair.pubKey,
|
||||
firstUse : true,
|
||||
timestamp : Date.now(),
|
||||
verified : textsecure.storage.protocol.VerifiedStatus.VERIFIED,
|
||||
nonblockingApproval : true
|
||||
});
|
||||
|
||||
textsecure.storage.put('identityKey', identityKeyPair);
|
||||
textsecure.storage.put('signaling_key', signalingKey);
|
||||
|
|
|
@ -203,10 +203,14 @@
|
|||
|
||||
// update our own identity key, which may have changed
|
||||
// if we're relinking after a reinstall on the master device
|
||||
var putIdentity = textsecure.storage.protocol.saveIdentity.bind(
|
||||
null, number, identityKeyPair.pubKey, true, true
|
||||
);
|
||||
textsecure.storage.protocol.removeIdentityKey(number).then(putIdentity, putIdentity);
|
||||
textsecure.storage.protocol.saveIdentityWithAttributes({
|
||||
id : number,
|
||||
publicKey : identityKeyPair.pubKey,
|
||||
firstUse : true,
|
||||
timestamp : Date.now(),
|
||||
verified : textsecure.storage.protocol.VerifiedStatus.VERIFIED,
|
||||
nonblockingApproval : true
|
||||
});
|
||||
|
||||
textsecure.storage.put('identityKey', identityKeyPair);
|
||||
textsecure.storage.put('signaling_key', signalingKey);
|
||||
|
|
Loading…
Add table
Reference in a new issue