mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Unshared messages.
This commit is contained in:
@@ -56,7 +56,7 @@ public interface DatabaseComponent {
|
||||
void addLocalAuthor(LocalAuthor a) throws DbException;
|
||||
|
||||
/** Stores a local message. */
|
||||
void addLocalMessage(Message m, ClientId c, Metadata meta)
|
||||
void addLocalMessage(Message m, ClientId c, Metadata meta, boolean shared)
|
||||
throws DbException;
|
||||
|
||||
/**
|
||||
@@ -277,8 +277,11 @@ public interface DatabaseComponent {
|
||||
void setLocalAuthorStatus(AuthorId a, StorageStatus s)
|
||||
throws DbException;
|
||||
|
||||
/** Marks the given message as shared or unshared. */
|
||||
void setMessageShared(Message m, boolean shared) throws DbException;
|
||||
|
||||
/** Marks the given message as valid or invalid. */
|
||||
void setMessageValidity(Message m, ClientId c, boolean valid)
|
||||
void setMessageValid(Message m, ClientId c, boolean valid)
|
||||
throws DbException;
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.sync.Message;
|
||||
|
||||
/** An event that is broadcast when a message is shared. */
|
||||
public class MessageSharedEvent extends Event {
|
||||
|
||||
private final Message message;
|
||||
|
||||
public MessageSharedEvent(Message message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Message getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -6,13 +6,13 @@ package org.briarproject.api.sync;
|
||||
*/
|
||||
public interface ValidationManager {
|
||||
|
||||
enum Status {
|
||||
enum Validity {
|
||||
|
||||
UNKNOWN(0), INVALID(1), VALID(2);
|
||||
|
||||
private final int value;
|
||||
|
||||
Status(int value) {
|
||||
Validity(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ public interface ValidationManager {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static Status fromValue(int value) {
|
||||
for (Status s : values()) if (s.value == value) return s;
|
||||
public static Validity fromValue(int value) {
|
||||
for (Validity s : values()) if (s.value == value) return s;
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user