Commit a94ffd41 authored by Torsten Grote's avatar Torsten Grote

Merge branch '1232-transfer-pending-contact-alias' into 'master'

Transfer pending contact alias to contact

See merge request !1124
parents 1f921753 6f285c5b
Pipeline #3460 passed with stage
in 7 minutes and 30 seconds
...@@ -84,10 +84,13 @@ class ContactManagerImpl implements ContactManager { ...@@ -84,10 +84,13 @@ class ContactManagerImpl implements ContactManager {
Author remote, AuthorId local, SecretKey rootKey, long timestamp, Author remote, AuthorId local, SecretKey rootKey, long timestamp,
boolean alice, boolean verified, boolean active) boolean alice, boolean verified, boolean active)
throws DbException, GeneralSecurityException { throws DbException, GeneralSecurityException {
PublicKey theirPublicKey = db.getPendingContact(txn, p).getPublicKey(); PendingContact pendingContact = db.getPendingContact(txn, p);
db.removePendingContact(txn, p); db.removePendingContact(txn, p);
PublicKey theirPublicKey = pendingContact.getPublicKey();
ContactId c = ContactId c =
db.addContact(txn, remote, local, theirPublicKey, verified); db.addContact(txn, remote, local, theirPublicKey, verified);
String alias = pendingContact.getAlias();
if (!alias.equals(remote.getName())) db.setContactAlias(txn, c, alias);
KeyPair ourKeyPair = identityManager.getHandshakeKeys(txn); KeyPair ourKeyPair = identityManager.getHandshakeKeys(txn);
keyManager.addContact(txn, c, theirPublicKey, ourKeyPair); keyManager.addContact(txn, c, theirPublicKey, ourKeyPair);
keyManager.addRotationKeys(txn, c, rootKey, timestamp, alice, active); keyManager.addRotationKeys(txn, c, rootKey, timestamp, alice, active);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment