[telepathy-gabble/master] Add API to retrieve capability set from presence

Will Thompson will.thompson at collabora.co.uk
Tue Sep 8 04:10:03 PDT 2009


This unions the old-style flags with the set of namespaces. It ignores
the ContactCaps hash table, which is about to be slain.
---
 src/presence.c |   16 ++++++++++++++++
 src/presence.h |    2 ++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/presence.c b/src/presence.c
index 0029d95..ace8bd0 100644
--- a/src/presence.c
+++ b/src/presence.c
@@ -168,6 +168,22 @@ resource_better_than (Resource *a, Resource *b)
     return (a->priority > b->priority);
 }
 
+GabbleCapabilitySet *
+gabble_presence_get_caps (GabblePresence *presence)
+{
+  GabbleCapabilitySet *ret, *tmp;
+
+  g_return_val_if_fail (presence != NULL, NULL);
+
+  ret = gabble_capability_set_copy (presence->priv->cap_set);
+
+  tmp = gabble_capability_set_new_from_flags (presence->caps);
+  gabble_capability_set_update (ret, tmp);
+  gabble_capability_set_free (tmp);
+
+  return ret;
+}
+
 const gchar *
 gabble_presence_pick_resource_by_caps (
     GabblePresence *presence,
diff --git a/src/presence.h b/src/presence.h
index f449794..6eee7ee 100644
--- a/src/presence.h
+++ b/src/presence.h
@@ -87,6 +87,8 @@ void gabble_presence_set_capabilities (GabblePresence *presence,
     GHashTable *per_channel_manager_caps,
     guint serial);
 
+GabbleCapabilitySet *gabble_presence_get_caps (GabblePresence *presence);
+
 const gchar *gabble_presence_pick_resource_by_caps (GabblePresence *presence,
     GabblePresenceCapabilities caps);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list