diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-04-12 21:41:42 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-04-12 21:41:42 +0200 |
commit | fbd3083d4a39c56fa7bea5f01bede2ad1d2536eb (patch) | |
tree | d0704ee0843abbef48ad12d069daeda0f20f0fed /src/main/java/de/pixart/messenger/xmpp | |
parent | 2b09dcd878912e7c4a5ea9bed9186a5aa48726a1 (diff) |
messages coming from known muc server are treated as muc when creating conversation
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index 03005b6e3..baf77d23d 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -1552,18 +1552,24 @@ public class XmppConnection implements Runnable { } } - public String getMucServer() { + public List<String> getMucServers() { + List<String> servers = new ArrayList<>(); synchronized (this.disco) { for (final Entry<Jid, ServiceDiscoveryResult> cursor : disco.entrySet()) { final ServiceDiscoveryResult value = cursor.getValue(); if (value.getFeatures().contains("http://jabber.org/protocol/muc") && !value.getFeatures().contains("jabber:iq:gateway") && !value.hasIdentity("conference", "irc")) { - return cursor.getKey().toString(); + servers.add(cursor.getKey().toString()); } } } - return null; + return servers; + } + + public String getMucServer() { + List<String> servers = getMucServers(); + return servers.size() > 0 ? servers.get(0) : null; } public int getTimeToNextAttempt() { |