diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-04-24 21:55:11 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-04-24 21:55:11 +0200 |
commit | 8fcedc431111bf33d3f23b922793cd721cdc1df9 (patch) | |
tree | 1a9288eed2a12017db183988ecb666047eebb011 /src/main/java/de/pixart/messenger | |
parent | 5527909775a4db91a2187435bbf1b5f3e31417f4 (diff) |
fixed condition to accept lmc if user reference exists
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/parser/MessageParser.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 8 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java index 597f84b39..94b3106bc 100644 --- a/src/main/java/de/pixart/messenger/parser/MessageParser.java +++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java @@ -539,7 +539,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) { @@ -573,7 +573,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/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index a6e798bc8..98c02a7b5 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -1795,13 +1795,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; } } |