mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Move remote wipe MessageType enum to briar-api
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package org.briarproject.briar.remotewipe;
|
||||
package org.briarproject.briar.api.remotewipe;
|
||||
|
||||
import org.briarproject.bramble.api.FormatException;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
@@ -7,7 +7,7 @@ import javax.annotation.concurrent.Immutable;
|
||||
|
||||
@Immutable
|
||||
@NotNullByDefault
|
||||
enum MessageType {
|
||||
public enum MessageType {
|
||||
|
||||
SETUP(0), WIPE(1);
|
||||
|
||||
@@ -17,11 +17,11 @@ enum MessageType {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
int getValue() {
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
static MessageType fromValue(int value) throws
|
||||
public static MessageType fromValue(int value) throws
|
||||
FormatException {
|
||||
for (MessageType m : values()) if (m.value == value) return m;
|
||||
throw new FormatException();
|
||||
@@ -16,18 +16,24 @@ import javax.annotation.concurrent.Immutable;
|
||||
public class RemoteWipeMessageHeader extends ConversationMessageHeader {
|
||||
|
||||
private final List<AttachmentHeader> attachmentHeaders;
|
||||
private final MessageType type;
|
||||
|
||||
public RemoteWipeMessageHeader(MessageId id, GroupId groupId, long timestamp,
|
||||
boolean local, boolean read, boolean sent, boolean seen,
|
||||
List<AttachmentHeader> headers) {
|
||||
List<AttachmentHeader> headers, MessageType type) {
|
||||
super(id, groupId, timestamp, local, read, sent, seen);
|
||||
this.attachmentHeaders = headers;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public List<AttachmentHeader> getAttachmentHeaders() {
|
||||
return attachmentHeaders;
|
||||
}
|
||||
|
||||
public MessageType getMessageType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T accept(ConversationMessageVisitor<T> v) {
|
||||
return v.visitRemoteWipeMessage(this);
|
||||
|
||||
Reference in New Issue
Block a user