~singpolyma/cheogram-android

4790412e9abcd67913b7fde3240163895dc492a0 — Stephen Paul Weber 2 months ago 40740f5
Add more things that the MUC might have changed before reflection
M src/main/java/eu/siacs/conversations/parser/MessageParser.java => src/main/java/eu/siacs/conversations/parser/MessageParser.java +1 -1
@@ 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) {

M src/main/java/eu/siacs/conversations/services/XmppConnectionService.java => src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +10 -5
@@ 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<Message.FileParams> 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);