From 4790412e9abcd67913b7fde3240163895dc492a0 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Thu, 4 Jul 2024 19:56:29 -0500 Subject: [PATCH] Add more things that the MUC might have changed before reflection --- .../siacs/conversations/parser/MessageParser.java | 2 +- .../services/XmppConnectionService.java | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index d1b7be2da..65584dfbd 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -633,7 +633,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece if (conversation.getMucOptions().isSelf(counterpart)) { status = Message.STATUS_SEND_RECEIVED; isCarbon = true; //not really carbon but received from another resource - if (mXmppConnectionService.markMessage(conversation, remoteMsgId, status, serverMsgId, body, html)) { + if (mXmppConnectionService.markMessage(conversation, remoteMsgId, status, serverMsgId, body, html, packet.findChildContent("subject"), packet.findChild("thread"), attachments)) { return; } else if (remoteMsgId == null || Config.IGNORE_ID_REWRITE_IN_MUC) { if (body != null) { diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index de6a21d61..ded1b6117 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -4982,10 +4982,10 @@ public class XmppConnectionService extends Service { } public boolean markMessage(final Conversation conversation, final String uuid, final int status, final String serverMessageId) { - return markMessage(conversation, uuid, status, serverMessageId, null, null); + return markMessage(conversation, uuid, status, serverMessageId, null, null, null, null, null); } - public boolean markMessage(final Conversation conversation, final String uuid, final int status, final String serverMessageId, final LocalizedContent body, final Element html) { + public boolean markMessage(final Conversation conversation, final String uuid, final int status, final String serverMessageId, final LocalizedContent body, final Element html, final String subject, final Element thread, final Set attachments) { if (uuid == null) { return false; } else { @@ -4994,13 +4994,18 @@ public class XmppConnectionService extends Service { if (message.getServerMsgId() == null) { message.setServerMsgId(serverMessageId); } - if (message.getEncryption() == Message.ENCRYPTION_NONE - && message.isTypeText() && (body != null || html != null)) { + if (message.getEncryption() == Message.ENCRYPTION_NONE && (body != null || html != null || subject != null || thread != null || attachments != null)) { message.setBody(body.content); - message.setHtml(html); if (body.count > 1) { message.setBodyLanguage(body.language); } + message.setHtml(html); + message.setSubject(subject); + message.setThread(thread); + if (attachments != null && attachments.isEmpty()) { + message.setFileParams(null); + message.setRelativeFilePath(null); + } markMessage(message, status, null, true); } else { markMessage(message, status); -- 2.45.2