fixed condition to accept lmc if user reference exists

This commit is contained in:
Daniel Gultsch 2018-04-14 14:55:51 +02:00
parent db8bd7b596
commit 32a105fa1c
2 changed files with 3 additions and 9 deletions

View File

@ -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();

View File

@ -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;
}
}