Show whether identities are anonymous, unknown, or verified.

Dev task #52. Known but unverified identities are also supported, but
currently unused. These will be used in future for contacts who've been
introduced but not verified face to face.
This commit is contained in:
akwizgran
2014-02-04 12:32:51 +00:00
parent 035fc4324f
commit a45d09ef5c
29 changed files with 197 additions and 95 deletions

View File

@@ -7,6 +7,8 @@ import java.io.UnsupportedEncodingException;
/** A pseudonym for a user. */
public class Author {
public enum Status { ANONYMOUS, UNKNOWN, UNVERIFIED, VERIFIED };
private final AuthorId id;
private final String name;
private final byte[] publicKey;

View File

@@ -9,16 +9,19 @@ public class MessageHeader {
private final MessageId id, parent;
private final GroupId groupId;
private final Author author;
private final Author.Status authorStatus;
private final String contentType;
private final long timestamp;
private final boolean read;
public MessageHeader(MessageId id, MessageId parent, GroupId groupId,
Author author, String contentType, long timestamp, boolean read) {
Author author, Author.Status authorStatus, String contentType,
long timestamp, boolean read) {
this.id = id;
this.parent = parent;
this.groupId = groupId;
this.author = author;
this.authorStatus = authorStatus;
this.contentType = contentType;
this.timestamp = timestamp;
this.read = read;
@@ -51,6 +54,11 @@ public class MessageHeader {
return author;
}
/** Returns the status of the message's author. */
public Author.Status getAuthorStatus() {
return authorStatus;
}
/** Returns the message's content type. */
public String getContentType() {
return contentType;