diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-09-07 17:02:18 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-09-07 17:02:18 +0100 |
commit | 30a7ac413f66178c3cceae63baab487365ef8845 (patch) | |
tree | 5df5ce86127cc5fa4c83d2bbaff12decadadbfc2 /src | |
parent | 485c9d8ad1365cbee11b8c7769425d5d5c02fc27 (diff) |
connection: add more public helper functions for getting caps
This is useful so in a Gabble plugin you can get the TpBaseContactList
and then look at each contact's caps for whatever reason.
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/connection.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/connection.c b/src/connection.c index 6e8a59ea..dd9bf0ad 100644 --- a/src/connection.c +++ b/src/connection.c @@ -3882,3 +3882,26 @@ gabble_connection_pick_best_resource_for_caps (GabbleConnection *connection, return gabble_presence_pick_resource_by_caps (presence, 0, predicate, user_data); } + +TpBaseContactList * +gabble_connection_get_contact_list (GabbleConnection *connection) +{ + g_return_val_if_fail (GABBLE_IS_CONNECTION (connection), NULL); + + return (TpBaseContactList *) connection->roster; +} + +WockyXep0115Capabilities * +gabble_connection_get_caps (GabbleConnection *connection, + TpHandle handle) +{ + GabblePresence *presence; + + g_return_val_if_fail (GABBLE_IS_CONNECTION (connection), NULL); + g_return_val_if_fail (handle > 0, NULL); + + presence = gabble_presence_cache_get (connection->presence_cache, + handle); + + return (WockyXep0115Capabilities *) presence; +} |