Don't allow local identities to be added as contacts.

This commit is contained in:
akwizgran
2016-04-11 13:24:25 +01:00
parent 770015e5f9
commit 40022b8326
2 changed files with 81 additions and 1 deletions

View File

@@ -157,6 +157,8 @@ class DatabaseComponentImpl<T> implements DatabaseComponent {
T txn = unbox(transaction);
if (!db.containsLocalAuthor(txn, local))
throw new NoSuchLocalAuthorException();
if (db.containsLocalAuthor(txn, remote.getId()))
throw new ContactExistsException();
if (db.containsContact(txn, remote.getId(), local))
throw new ContactExistsException();
ContactId c = db.addContact(txn, remote, local, active);