Don't add threaded messages to the UI before their parents.

This commit is contained in:
akwizgran
2017-08-15 14:46:40 +01:00
parent ed01048f9f
commit ba727d7568
20 changed files with 130 additions and 145 deletions

View File

@@ -21,6 +21,8 @@ public interface MessageTree<T extends MessageTree.MessageNode> {
Collection<T> depthFirstOrder();
boolean contains(MessageId m);
@NotNullByDefault
interface MessageNode {

View File

@@ -14,21 +14,26 @@ import javax.annotation.concurrent.Immutable;
@NotNullByDefault
public class ForumPostReceivedEvent extends Event {
private final ForumPostHeader forumPostHeader;
private final GroupId groupId;
private final ForumPostHeader header;
private final String body;
public ForumPostReceivedEvent(ForumPostHeader forumPostHeader,
GroupId groupId) {
this.forumPostHeader = forumPostHeader;
public ForumPostReceivedEvent(GroupId groupId, ForumPostHeader header,
String body) {
this.groupId = groupId;
}
public ForumPostHeader getForumPostHeader() {
return forumPostHeader;
this.header = header;
this.body = body;
}
public GroupId getGroupId() {
return groupId;
}
public ForumPostHeader getHeader() {
return header;
}
public String getBody() {
return body;
}
}

View File

@@ -17,13 +17,14 @@ public class GroupMessageAddedEvent extends Event {
private final GroupId groupId;
private final GroupMessageHeader header;
private final String body;
private final boolean local;
public GroupMessageAddedEvent(GroupId groupId, GroupMessageHeader header,
boolean local) {
String body, boolean local) {
this.groupId = groupId;
this.header = header;
this.body = body;
this.local = local;
}
@@ -35,6 +36,10 @@ public class GroupMessageAddedEvent extends Event {
return header;
}
public String getBody() {
return body;
}
public boolean isLocal() {
return local;
}