diff options
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() { |