mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Introduce client layer events for forums
The forum UI depended on sync layer events such as MessageStateChangedEvent. Now, the forum client broadcasts its own high-level event (`ForumPostReceivedEvent`) with the information the UI needs (`ForumPostHeader`). Closes #310
This commit is contained in:
@@ -8,9 +8,10 @@ import java.util.Comparator;
|
||||
public interface MessageTree<T extends MessageTree.MessageNode> {
|
||||
|
||||
void add(Collection<T> nodes);
|
||||
void add(T node);
|
||||
void setComparator(Comparator<T> comparator);
|
||||
void clear();
|
||||
Collection<T> depthFirstOrder();
|
||||
void setComparator(Comparator<T> comparator);
|
||||
|
||||
interface MessageNode {
|
||||
MessageId getId();
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.forum.ForumPostHeader;
|
||||
import org.briarproject.api.messaging.PrivateMessageHeader;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
|
||||
/**
|
||||
* An event that is broadcast when a new forum post was received.
|
||||
*/
|
||||
public class ForumPostReceivedEvent extends Event {
|
||||
|
||||
private final ForumPostHeader forumPostHeader;
|
||||
private final GroupId groupId;
|
||||
|
||||
public ForumPostReceivedEvent(ForumPostHeader forumPostHeader,
|
||||
GroupId groupId) {
|
||||
|
||||
this.forumPostHeader = forumPostHeader;
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public ForumPostHeader getForumPostHeader() {
|
||||
return forumPostHeader;
|
||||
}
|
||||
|
||||
public GroupId getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user