Add connection_item_for_feature()

This commit is contained in:
James Booth
2016-05-08 01:45:22 +01:00
parent f28655c5c8
commit 137202e5dd
3 changed files with 37 additions and 35 deletions

View File

@@ -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)
{