Call KeyManager#AddContact when restoring contacts

This commit is contained in:
ameba23
2021-06-29 11:43:14 +02:00
parent eb66a13ded
commit 4b9c3a1a96
4 changed files with 17 additions and 4 deletions

View File

@@ -122,9 +122,12 @@ class ContactManagerImpl implements ContactManager, EventListener {
@Override
public ContactId addContact(Transaction txn, Author remote, AuthorId local,
PublicKey handshake, boolean verified) throws DbException {
PublicKey handshake, boolean verified)
throws DbException, GeneralSecurityException {
ContactId c = db.addContact(txn, remote, local, handshake, verified);
Contact contact = db.getContact(txn, c);
KeyPair ourKeyPair = identityManager.getHandshakeKeys(txn);
keyManager.addContact(txn, c, handshake, ourKeyPair);
for (ContactHook hook : hooks) hook.addingContact(txn, contact);
return c;
}