From 32a105fa1c0310933b9a9c38d4916893a3f5e3c9 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 14 Apr 2018 14:55:51 +0200 Subject: [PATCH] fixed condition to accept lmc if user reference exists --- .../java/eu/siacs/conversations/parser/MessageParser.java | 4 ++-- .../conversations/services/XmppConnectionService.java | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index b4f61796d..c84d401e1 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -430,7 +430,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece } message.markable = packet.hasChild("markable", "urn:xmpp:chat-markers:0"); if (conversationMultiMode) { - message.setMucUser(conversation.getMucOptions().findUserByFullJid(message.getCounterpart())); + message.setMucUser(conversation.getMucOptions().findUserByFullJid(counterpart)); final Jid fallback = conversation.getMucOptions().getTrueCounterpart(counterpart); Jid trueCounterpart; if (message.getEncryption() == Message.ENCRYPTION_AXOLOTL) { @@ -464,7 +464,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece && replacedMessage.getTrueCounterpart().equals(message.getTrueCounterpart()); final boolean mucUserMatches = query == null && replacedMessage.sameMucUser(message); //can not be checked when using mam final boolean duplicate = conversation.hasDuplicateMessage(message); - if (fingerprintsMatch && (trueCountersMatch || !conversationMultiMode || !mucUserMatches) && !duplicate) { + if (fingerprintsMatch && (trueCountersMatch || !conversationMultiMode || mucUserMatches) && !duplicate) { Log.d(Config.LOGTAG, "replaced message '" + replacedMessage.getBody() + "' with '" + message.getBody() + "'"); synchronized (replacedMessage) { final String uuid = replacedMessage.getUuid(); diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index ab6084c67..9822da360 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -1608,13 +1608,7 @@ public class XmppConnectionService extends Service { public boolean isConversationsListEmpty(final Conversation ignore) { synchronized (this.conversations) { final int size = this.conversations.size(); - if (size == 0) { - return true; - } else if (size == 1) { - return this.conversations.get(0) == ignore; - } else { - return false; - } + return size == 0 || size == 1 && this.conversations.get(0) == ignore; } }