[Telepathy-commits] [telepathy-glib/master] Add a register function instead that registers the right interface name and utility function

Sjoerd Simons sjoerd at luon.net
Tue Aug 19 04:25:20 PDT 2008


20080728163809-93b9a-f138dd7c9034a7cdc29417ee01ad59aa89471921.gz
---
 telepathy-glib/presence-mixin.c |   20 +++++++++++++++++++-
 telepathy-glib/presence-mixin.h |    4 ++--
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/telepathy-glib/presence-mixin.c b/telepathy-glib/presence-mixin.c
index 324786d..4a1a740 100644
--- a/telepathy-glib/presence-mixin.c
+++ b/telepathy-glib/presence-mixin.c
@@ -1353,7 +1353,7 @@ simple_presence_get_attributes_foreach (gpointer key,
     val);
 }
 
-void
+static void
 tp_presence_mixin_simple_presence_get_attributes (GObject *obj,
   const GArray *contacts, GHashTable *attributes_hash)
 {
@@ -1373,3 +1373,21 @@ tp_presence_mixin_simple_presence_get_attributes (GObject *obj,
 
   g_hash_table_destroy (contact_statuses);
 }
+
+/**
+ * tp_presence_mixin_simple_presence_register_with_contacts_iface:
+ * @obj: An instance that of the implementation that uses both the Contacts
+ * mixin and this mixin
+ *
+ * Register the SimplePresence interface with the Contacts interface to make it
+ * inspectable. The Contacts mixin should be initialized before this function
+ * is called
+ */
+void
+tp_presence_mixin_simple_presence_register_with_contacts_iface (GObject *obj)
+{
+  tp_contacts_mixin_add_inspectable_iface (obj,
+      TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE,
+      tp_presence_mixin_simple_presence_get_attributes);
+}
+
diff --git a/telepathy-glib/presence-mixin.h b/telepathy-glib/presence-mixin.h
index 3a24304..caa7294 100644
--- a/telepathy-glib/presence-mixin.h
+++ b/telepathy-glib/presence-mixin.h
@@ -259,8 +259,8 @@ void tp_presence_mixin_iface_init (gpointer g_iface, gpointer iface_data);
 void tp_presence_mixin_simple_presence_iface_init (gpointer g_iface, gpointer iface_data);
 void tp_presence_mixin_simple_presence_init_dbus_properties (GObjectClass *cls);
 
-void tp_presence_mixin_simple_presence_get_attributes (GObject *obj,
-  const GArray *contacts, GHashTable *attributes_hash);
+void tp_presence_mixin_simple_presence_register_with_contacts_iface (
+    GObject *obj);
 
 G_END_DECLS
 
-- 
1.5.6.3




More information about the Telepathy-commits mailing list