aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-06-30 11:43:00 +0200
committeriNPUTmice <daniel@gultsch.de>2014-06-30 11:43:00 +0200
commitdcb21cb9e672c08f8731978be5079e1f23130b64 (patch)
tree69d5f926eac51a2b14133b09d06a591d47e9cde3 /src/eu/siacs/conversations
parent9a239f65897040ffd8662ec981315287bfc49673 (diff)
couple of modifications for disco discovery
Diffstat (limited to 'src/eu/siacs/conversations')
-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;
}