[telepathy-gabble/master] gabble_presence_has_resources(): add

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Jan 5 10:59:09 PST 2010


We'll sometimes need to deal with presences that have no resources, just
presence for the bare JID (like gateway users).
---
 src/presence.c |    6 ++++++
 src/presence.h |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/presence.c b/src/presence.c
index 19a1df1..9047a7b 100644
--- a/src/presence.c
+++ b/src/presence.c
@@ -173,6 +173,12 @@ gabble_presence_peek_caps (GabblePresence *presence)
   return presence->priv->cap_set;
 }
 
+gboolean
+gabble_presence_has_resources (GabblePresence *self)
+{
+  return (self->priv->resources != NULL);
+}
+
 const gchar *
 gabble_presence_pick_resource_by_caps (
     GabblePresence *presence,
diff --git a/src/presence.h b/src/presence.h
index b1422b2..ea16c36 100644
--- a/src/presence.h
+++ b/src/presence.h
@@ -87,6 +87,7 @@ gboolean gabble_presence_has_cap (GabblePresence *presence, const gchar *ns);
 GabbleCapabilitySet *gabble_presence_dup_caps (GabblePresence *presence);
 const GabbleCapabilitySet *gabble_presence_peek_caps (GabblePresence *presence);
 
+gboolean gabble_presence_has_resources (GabblePresence *self);
 const gchar *gabble_presence_pick_resource_by_caps (GabblePresence *presence,
     GabbleCapabilitySetPredicate predicate, gconstpointer user_data);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list