diff options
author | James Booth <boothj5@gmail.com> | 2016-05-08 01:45:22 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-05-08 01:45:22 +0100 |
commit | 137202e5dd72175989e251cb890ef051adf641eb (patch) | |
tree | 414d52e2220901b1fad3ac7e1e8926431a793cd8 /src/xmpp/connection.c | |
parent | f28655c5c8a58aa0a55b7e0509c58ff1d50beec7 (diff) | |
download | profani-tty-137202e5dd72175989e251cb890ef051adf641eb.tar.gz |
Add connection_item_for_feature()
Diffstat (limited to 'src/xmpp/connection.c')
-rw-r--r-- | src/xmpp/connection.c | 16 |
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) { |