From f0cfbb4681e523e629dbc39e82a62bded4fce885 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 31 Mar 2018 22:01:17 +0200 Subject: [PATCH] fixed muc detection for rare cases where muc is hosted on primary domain --- .../java/eu/siacs/conversations/parser/MessageParser.java | 2 +- .../java/eu/siacs/conversations/xmpp/XmppConnection.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index fe6b8a1fb..a4f039a4f 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -310,7 +310,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; diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 1a5dcc117..3cd2e79be 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -1521,6 +1521,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) {