mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 13:49:53 +01:00
Add method for adding a contact without transport keys.
This commit is contained in:
@@ -23,13 +23,21 @@ public interface ContactManager {
|
|||||||
void registerRemoveContactHook(RemoveContactHook hook);
|
void registerRemoveContactHook(RemoveContactHook hook);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores a contact within the given transaction associated with the given
|
* Stores a contact associated with the given local and remote pseudonyms,
|
||||||
* local and remote pseudonyms, and returns an ID for the contact.
|
* derives and stores transport keys for each transport, and returns an ID
|
||||||
|
* for the contact.
|
||||||
*/
|
*/
|
||||||
ContactId addContact(Transaction txn, Author remote, AuthorId local,
|
ContactId addContact(Transaction txn, Author remote, AuthorId local,
|
||||||
SecretKey master, long timestamp, boolean alice, boolean verified,
|
SecretKey master, long timestamp, boolean alice, boolean verified,
|
||||||
boolean active) throws DbException;
|
boolean active) throws DbException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stores a contact associated with the given local and remote pseudonyms
|
||||||
|
* and returns an ID for the contact.
|
||||||
|
*/
|
||||||
|
ContactId addContact(Transaction txn, Author remote, AuthorId local,
|
||||||
|
boolean verified, boolean active) throws DbException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores a contact associated with the given local and remote pseudonyms,
|
* Stores a contact associated with the given local and remote pseudonyms,
|
||||||
* and returns an ID for the contact.
|
* and returns an ID for the contact.
|
||||||
|
|||||||
@@ -60,6 +60,16 @@ class ContactManagerImpl implements ContactManager {
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContactId addContact(Transaction txn, Author remote, AuthorId local,
|
||||||
|
boolean verified, boolean active) throws DbException {
|
||||||
|
ContactId c = db.addContact(txn, remote, local, verified, active);
|
||||||
|
Contact contact = db.getContact(txn, c);
|
||||||
|
for (AddContactHook hook : addHooks)
|
||||||
|
hook.addingContact(txn, contact);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ContactId addContact(Author remote, AuthorId local, SecretKey master,
|
public ContactId addContact(Author remote, AuthorId local, SecretKey master,
|
||||||
long timestamp, boolean alice, boolean verified, boolean active)
|
long timestamp, boolean alice, boolean verified, boolean active)
|
||||||
|
|||||||
Reference in New Issue
Block a user