mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 05:09:53 +01:00
Moved MessageHeader into DB component and added read/starred flags.
This commit is contained in:
@@ -16,7 +16,6 @@ import net.sf.briar.api.protocol.Batch;
|
||||
import net.sf.briar.api.protocol.Group;
|
||||
import net.sf.briar.api.protocol.GroupId;
|
||||
import net.sf.briar.api.protocol.Message;
|
||||
import net.sf.briar.api.protocol.MessageHeader;
|
||||
import net.sf.briar.api.protocol.MessageId;
|
||||
import net.sf.briar.api.protocol.Offer;
|
||||
import net.sf.briar.api.protocol.SubscriptionUpdate;
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
package net.sf.briar.api.protocol;
|
||||
package net.sf.briar.api.db;
|
||||
|
||||
import net.sf.briar.api.protocol.AuthorId;
|
||||
import net.sf.briar.api.protocol.GroupId;
|
||||
import net.sf.briar.api.protocol.MessageId;
|
||||
|
||||
public interface MessageHeader {
|
||||
|
||||
@@ -22,4 +26,10 @@ public interface MessageHeader {
|
||||
|
||||
/** Returns the timestamp created by the message's author. */
|
||||
long getTimestamp();
|
||||
|
||||
/** Returns true if the message has been read. */
|
||||
boolean getRead();
|
||||
|
||||
/** Returns true if the message has been starred. */
|
||||
boolean getStarred();
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package net.sf.briar.api.protocol;
|
||||
|
||||
public interface Message extends MessageHeader {
|
||||
public interface Message {
|
||||
|
||||
/**
|
||||
* The maximum length of a message body in bytes. To allow for future
|
||||
@@ -19,6 +19,27 @@ public interface Message extends MessageHeader {
|
||||
/** The length of the random salt in bytes. */
|
||||
static final int SALT_LENGTH = 8;
|
||||
|
||||
/** Returns the message's unique identifier. */
|
||||
MessageId getId();
|
||||
|
||||
/**
|
||||
* Returns the message's parent, or MessageId.NONE if this is the first
|
||||
* message in a thread.
|
||||
*/
|
||||
MessageId getParent();
|
||||
|
||||
/** Returns the group to which the message belongs. */
|
||||
GroupId getGroup();
|
||||
|
||||
/** Returns the message's author. */
|
||||
AuthorId getAuthor();
|
||||
|
||||
/** Returns the message's subject line. */
|
||||
String getSubject();
|
||||
|
||||
/** Returns the timestamp created by the message's author. */
|
||||
long getTimestamp();
|
||||
|
||||
/** Returns the length of the serialised message in bytes. */
|
||||
int getLength();
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package net.sf.briar.api.protocol;
|
||||
|
||||
public interface MessageHeaderFactory {
|
||||
|
||||
MessageHeader createMessageHeader(MessageId id, MessageId parent,
|
||||
GroupId group, AuthorId author, String subject, long timestamp);
|
||||
}
|
||||
Reference in New Issue
Block a user