about summary refs log tree commit diff stats
path: root/src/xmpp/connection.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-05-08 01:45:22 +0100
committerJames Booth <boothj5@gmail.com>2016-05-08 01:45:22 +0100
commit137202e5dd72175989e251cb890ef051adf641eb (patch)
tree414d52e2220901b1fad3ac7e1e8926431a793cd8 /src/xmpp/connection.c
parentf28655c5c8a58aa0a55b7e0509c58ff1d50beec7 (diff)
downloadprofani-tty-137202e5dd72175989e251cb890ef051adf641eb.tar.gz
Add connection_item_for_feature()
Diffstat (limited to 'src/xmpp/connection.c')
-rw-r--r--src/xmpp/connection.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c
index 1c85bf79..4c34fda4 100644
--- a/src/xmpp/connection.c
+++ b/src/xmpp/connection.c
@@ -391,6 +391,22 @@ connection_supports(const char *const feature)
     return FALSE;
 }
 
+char*
+connection_item_for_feature(const char *const feature)
+{
+    DiscoInfo *disco_info;
+    GSList *curr = conn.disco_items;
+    while (curr) {
+        disco_info = curr->data;
+        if (g_hash_table_lookup_extended(disco_info->features, feature, NULL, NULL)) {
+            return disco_info->item;
+        }
+        curr = g_slist_next(curr);
+    }
+
+    return NULL;
+}
+
 void
 connection_set_disco_items(GSList *items)
 {