From f61d006835b9690daeebb20963ca2a2b75ae30cb Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 22 Apr 2018 19:27:32 +0200 Subject: fixed muc detection for rare cases where muc is hosted on primary domain --- src/main/java/de/pixart/messenger/parser/MessageParser.java | 2 +- src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger') diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java index 86fae5b87..76318e0f2 100644 --- a/src/main/java/de/pixart/messenger/parser/MessageParser.java +++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java @@ -413,7 +413,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece } if ((body != null || pgpEncrypted != null || (axolotlEncrypted != null && axolotlEncrypted.hasChild("payload")) || oobUrl != null) && !isMucStatusMessage) { - final boolean conversationIsProbablyMuc = isTypeGroupChat || mucUserElement != null || account.getXmppConnection().getMucServers().contains(counterpart.getDomain()); + final boolean conversationIsProbablyMuc = isTypeGroupChat || mucUserElement != null || account.getXmppConnection().getMucServersWithholdAccount().contains(counterpart.getDomain()); final Conversation conversation = mXmppConnectionService.findOrCreateConversation(account, counterpart.asBareJid(), conversationIsProbablyMuc, false, query, false); final boolean conversationMultiMode = conversation.getMode() == Conversation.MODE_MULTI; if (serverMsgId == null) { diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index baf77d23d..867fb824e 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -1552,6 +1552,12 @@ public class XmppConnection implements Runnable { } } + public List getMucServersWithholdAccount() { + List servers = getMucServers(); + servers.remove(account.getServer()); + return servers; + } + public List getMucServers() { List servers = new ArrayList<>(); synchronized (this.disco) { -- cgit v1.2.3