diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index 02aa247dbe5ea16c77543193e25b83f8529c0a53..abda7b8de141b1c5ad3a14c9c1a5db11e075f652 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -438,7 +438,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable return m; } - public void clearReplyReact() { + public synchronized void clearReplyReact() { mInReplyTo = null; this.payloads.remove(getReactionsEl()); this.payloads.remove(getReply()); @@ -486,7 +486,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable addPayload(reactions); } - public Element getReply() { + public synchronized Element getReply() { if (this.payloads == null) return null; for (Element el : this.payloads) { @@ -498,7 +498,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable return null; } - public boolean isAttention() { + public synchronized boolean isAttention() { if (this.payloads == null) return false; for (Element el : this.payloads) { @@ -1302,21 +1302,21 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable } } - public void clearPayloads() { + public synchronized void clearPayloads() { this.payloads.clear(); } - public void addPayload(Element el) { + public synchronized void addPayload(Element el) { if (el == null) return; this.payloads.add(el); } - public List getPayloads() { + public synchronized List getPayloads() { return new ArrayList<>(this.payloads); } - public List getFallbacks(String... includeFor) { + public synchronized List getFallbacks(String... includeFor) { List fallbacks = new ArrayList<>(); if (this.payloads == null) return fallbacks; @@ -1341,7 +1341,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable return getHtml(false); } - public Element getHtml(boolean root) { + public synchronized Element getHtml(boolean root) { if (this.payloads == null) return null; for (Element el : this.payloads) { @@ -1353,7 +1353,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable return null; } - public List getCommands() { + public synchronized List getCommands() { if (this.payloads == null) return null; for (Element el : this.payloads) { @@ -1365,7 +1365,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable return null; } - public List getLinkDescriptions() { + public synchronized List getLinkDescriptions() { final ArrayList result = new ArrayList<>(); if (this.payloads == null) return result;