mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Attach group visibility to MessageSharedEvent.
This allows listeners to decide whether to act on the event.
This commit is contained in:
@@ -283,6 +283,13 @@ public interface DatabaseComponent extends TransactionManager {
|
||||
*/
|
||||
Group getGroup(Transaction txn, GroupId g) throws DbException;
|
||||
|
||||
/**
|
||||
* Returns the ID of the group containing the given message.
|
||||
* <p/>
|
||||
* Read-only.
|
||||
*/
|
||||
GroupId getGroupId(Transaction txn, MessageId m) throws DbException;
|
||||
|
||||
/**
|
||||
* Returns the metadata for the given group.
|
||||
* <p/>
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package org.briarproject.bramble.api.sync.event;
|
||||
|
||||
import org.briarproject.bramble.api.contact.ContactId;
|
||||
import org.briarproject.bramble.api.event.Event;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.bramble.api.sync.GroupId;
|
||||
import org.briarproject.bramble.api.sync.MessageId;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
/**
|
||||
@@ -14,12 +18,25 @@ import javax.annotation.concurrent.Immutable;
|
||||
public class MessageSharedEvent extends Event {
|
||||
|
||||
private final MessageId messageId;
|
||||
private final GroupId groupId;
|
||||
private final Map<ContactId, Boolean> groupVisibility;
|
||||
|
||||
public MessageSharedEvent(MessageId message) {
|
||||
public MessageSharedEvent(MessageId message, GroupId groupId,
|
||||
Map<ContactId, Boolean> groupVisibility) {
|
||||
this.messageId = message;
|
||||
this.groupId = groupId;
|
||||
this.groupVisibility = groupVisibility;
|
||||
}
|
||||
|
||||
public MessageId getMessageId() {
|
||||
return messageId;
|
||||
}
|
||||
|
||||
public GroupId getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public Map<ContactId, Boolean> getGroupVisibility() {
|
||||
return groupVisibility;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user