From dcb21cb9e672c08f8731978be5079e1f23130b64 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Mon, 30 Jun 2014 11:43:00 +0200 Subject: [PATCH] couple of modifications for disco discovery --- .../siacs/conversations/xmpp/XmppConnection.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index c098fb112..b2829c6ea 100644 --- a/src/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java @@ -924,16 +924,25 @@ public class XmppConnection implements Runnable { return disco.get(server).contains(feature); } - public String findDiscoItemByFeature(String feature) { + public List findDiscoItemsByFeature(String feature) { + List items = new ArrayList(); Iterator>> it = this.disco.entrySet() .iterator(); while (it.hasNext()) { Entry> pairs = it.next(); - if (pairs.getValue().contains(feature)&&pairs.getValue().size()==1) { - return pairs.getKey(); + if (pairs.getValue().contains(feature)) { + items.add(pairs.getKey()); } it.remove(); } + return items; + } + + public String findDiscoItemByFeature(String feature) { + List items = findDiscoItemsByFeature(feature); + if (items.size()>=1) { + return items.get(0); + } return null; }