From 6a709a123cf99d832f1424f13553be7ff5214712 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 6 Sep 2023 21:22:03 -0500 Subject: [PATCH] Show only one moderated message for a big streak of them --- src/main/java/eu/siacs/conversations/entities/Message.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index 8896bd075..4f39e1bb6 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -927,6 +927,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable (this.getSubject() == null || this.getSubject().equals(message.getSubject())) && (this.getThread() == null || (message.getThread() != null && this.getThread().toString().equals(message.getThread().toString()))) && this.getBody().length() + message.getBody().length() <= Config.MAX_DISPLAY_MESSAGE_CHARS && + this.getModerated() == null && !message.isGeoUri() && !this.isGeoUri() && !message.isOOb() && @@ -1044,7 +1045,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable Message current = this; while (current.mergeable(current.next())) { current = current.next(); - if (current == null) { + if (current == null || current.getModerated() != null) { break; } body.append("\n\n"); @@ -1087,6 +1088,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable public boolean wasMergedIntoPrevious() { Message prev = this.prev(); + if (getModerated() != null && prev.getModerated() != null) return true; return prev != null && prev.mergeable(this); } -- 2.45.2