Add introduced contacts as UNVERIFIED

Closes #580
This commit is contained in:
Torsten Grote
2016-08-10 12:35:33 -03:00
parent 70b311db13
commit e690bcb3cc
22 changed files with 201 additions and 126 deletions

View File

@@ -8,13 +8,14 @@ public class Contact {
private final ContactId id;
private final Author author;
private final AuthorId localAuthorId;
private final boolean active;
private final boolean verified, active;
public Contact(ContactId id, Author author, AuthorId localAuthorId,
boolean active) {
boolean verified, boolean active) {
this.id = id;
this.author = author;
this.localAuthorId = localAuthorId;
this.verified = verified;
this.active = active;
}
@@ -30,6 +31,10 @@ public class Contact {
return localAuthorId;
}
public boolean isVerified() {
return verified;
}
public boolean isActive() {
return active;
}

View File

@@ -21,16 +21,16 @@ public interface ContactManager {
* local and remote pseudonyms, and returns an ID for the contact.
*/
ContactId addContact(Transaction txn, Author remote, AuthorId local,
SecretKey master, long timestamp, boolean alice, boolean active)
throws DbException;
SecretKey master, long timestamp, boolean alice, boolean verified,
boolean active) throws DbException;
/**
* Stores a contact associated with the given local and remote pseudonyms,
* and returns an ID for the contact.
*/
ContactId addContact(Author remote, AuthorId local,
SecretKey master, long timestamp, boolean alice, boolean active)
throws DbException;
SecretKey master, long timestamp, boolean alice, boolean verified,
boolean active) throws DbException;
/** Returns the contact with the given ID. */
Contact getContact(ContactId c) throws DbException;

View File

@@ -62,7 +62,7 @@ public interface DatabaseComponent {
* and returns an ID for the contact.
*/
ContactId addContact(Transaction txn, Author remote, AuthorId local,
boolean active) throws DbException;
boolean verified, boolean active) throws DbException;
/**
* Stores a group.
@@ -423,6 +423,12 @@ public interface DatabaseComponent {
*/
void removeTransport(Transaction txn, TransportId t) throws DbException;
/**
* Marks the given contact as verified or unverified.
*/
void setContactVerified(Transaction txn, ContactId c, boolean verified)
throws DbException;
/**
* Marks the given contact as active or inactive.
*/