mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Generate message and group IDs in a forward-compatible way.
This commit is contained in:
@@ -10,6 +10,11 @@ public class Group {
|
||||
SHARED // The group is visible and messages are shared
|
||||
}
|
||||
|
||||
/**
|
||||
* The current version of the group format.
|
||||
*/
|
||||
public static final int FORMAT_VERSION = 1;
|
||||
|
||||
private final GroupId id;
|
||||
private final ClientId clientId;
|
||||
private final byte[] descriptor;
|
||||
|
||||
@@ -5,6 +5,11 @@ import static org.briarproject.bramble.api.sync.SyncConstants.MESSAGE_HEADER_LEN
|
||||
|
||||
public class Message {
|
||||
|
||||
/**
|
||||
* The current version of the message format.
|
||||
*/
|
||||
public static final int FORMAT_VERSION = 1;
|
||||
|
||||
private final MessageId id;
|
||||
private final GroupId groupId;
|
||||
private final long timestamp;
|
||||
|
||||
@@ -16,7 +16,13 @@ public class MessageId extends UniqueId {
|
||||
/**
|
||||
* Label for hashing messages to calculate their identifiers.
|
||||
*/
|
||||
public static final String LABEL = "org.briarproject.bramble/MESSAGE_ID";
|
||||
public static final String ID_LABEL = "org.briarproject.bramble/MESSAGE_ID";
|
||||
|
||||
/**
|
||||
* Label for hashing the root blocks of messages.
|
||||
*/
|
||||
public static final String ROOT_LABEL =
|
||||
"org.briarproject.bramble/MESSAGE_ROOT";
|
||||
|
||||
public MessageId(byte[] id) {
|
||||
super(id);
|
||||
|
||||
Reference in New Issue
Block a user