mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
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
|
@ -38122,10 +38122,14 @@ var TextSecureServer = (function() {
|
||||||
|
|
||||||
// update our own identity key, which may have changed
|
// update our own identity key, which may have changed
|
||||||
// if we're relinking after a reinstall on the master device
|
// if we're relinking after a reinstall on the master device
|
||||||
var putIdentity = textsecure.storage.protocol.saveIdentity.bind(
|
textsecure.storage.protocol.saveIdentityWithAttributes({
|
||||||
null, number, identityKeyPair.pubKey, true, true
|
id : number,
|
||||||
);
|
publicKey : identityKeyPair.pubKey,
|
||||||
textsecure.storage.protocol.removeIdentityKey(number).then(putIdentity, putIdentity);
|
firstUse : true,
|
||||||
|
timestamp : Date.now(),
|
||||||
|
verified : textsecure.storage.protocol.VerifiedStatus.VERIFIED,
|
||||||
|
nonblockingApproval : true
|
||||||
|
});
|
||||||
|
|
||||||
textsecure.storage.put('identityKey', identityKeyPair);
|
textsecure.storage.put('identityKey', identityKeyPair);
|
||||||
textsecure.storage.put('signaling_key', signalingKey);
|
textsecure.storage.put('signaling_key', signalingKey);
|
||||||
|
|
|
@ -203,10 +203,14 @@
|
||||||
|
|
||||||
// update our own identity key, which may have changed
|
// update our own identity key, which may have changed
|
||||||
// if we're relinking after a reinstall on the master device
|
// if we're relinking after a reinstall on the master device
|
||||||
var putIdentity = textsecure.storage.protocol.saveIdentity.bind(
|
textsecure.storage.protocol.saveIdentityWithAttributes({
|
||||||
null, number, identityKeyPair.pubKey, true, true
|
id : number,
|
||||||
);
|
publicKey : identityKeyPair.pubKey,
|
||||||
textsecure.storage.protocol.removeIdentityKey(number).then(putIdentity, putIdentity);
|
firstUse : true,
|
||||||
|
timestamp : Date.now(),
|
||||||
|
verified : textsecure.storage.protocol.VerifiedStatus.VERIFIED,
|
||||||
|
nonblockingApproval : true
|
||||||
|
});
|
||||||
|
|
||||||
textsecure.storage.put('identityKey', identityKeyPair);
|
textsecure.storage.put('identityKey', identityKeyPair);
|
||||||
textsecure.storage.put('signaling_key', signalingKey);
|
textsecure.storage.put('signaling_key', signalingKey);
|
||||||
|
|
Loading…
Reference in a new issue