aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu')
-rw-r--r--src/eu/siacs/conversations/xmpp/XmppConnection.java15
1 files changed, 12 insertions, 3 deletions
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<String> findDiscoItemsByFeature(String feature) {
+ List<String> items = new ArrayList<String>();
Iterator<Entry<String, List<String>>> it = this.disco.entrySet()
.iterator();
while (it.hasNext()) {
Entry<String, List<String>> 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<String> items = findDiscoItemsByFeature(feature);
+ if (items.size()>=1) {
+ return items.get(0);
+ }
return null;
}