fixed muc detection for rare cases where muc is hosted on primary domain

This commit is contained in:
Daniel Gultsch 2018-03-31 22:01:17 +02:00
parent c0d977e97d
commit f0cfbb4681
2 changed files with 7 additions and 1 deletions

View file

@ -310,7 +310,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
} }
if ((body != null || pgpEncrypted != null || (axolotlEncrypted != null && axolotlEncrypted.hasChild("payload")) || oobUrl != null) && !isMucStatusMessage) { 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 Conversation conversation = mXmppConnectionService.findOrCreateConversation(account, counterpart.asBareJid(), conversationIsProbablyMuc, false, query, false);
final boolean conversationMultiMode = conversation.getMode() == Conversation.MODE_MULTI; final boolean conversationMultiMode = conversation.getMode() == Conversation.MODE_MULTI;

View file

@ -1521,6 +1521,12 @@ public class XmppConnection implements Runnable {
} }
} }
public List<String> getMucServersWithholdAccount() {
List<String> servers = getMucServers();
servers.remove(account.getServer());
return servers;
}
public List<String> getMucServers() { public List<String> getMucServers() {
List<String> servers = new ArrayList<>(); List<String> servers = new ArrayList<>();
synchronized (this.disco) { synchronized (this.disco) {