From dcb21cb9e672c08f8731978be5079e1f23130b64 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Mon, 30 Jun 2014 11:43:00 +0200 Subject: couple of modifications for disco discovery --- src/eu/siacs/conversations/xmpp/XmppConnection.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/eu/siacs') diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index c098fb11..b2829c6e 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; } -- cgit v1.2.3