[Telepathy-commits] [telepathy-salut/master] Add basic inspectotron support

Sjoerd Simons sjoerd.simons at collabora.co.uk
Tue Aug 19 08:23:26 PDT 2008


---
 src/salut-connection.c |   11 +++++++++++
 src/salut-connection.h |    3 +++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/salut-connection.c b/src/salut-connection.c
index b388205..f43796b 100644
--- a/src/salut-connection.c
+++ b/src/salut-connection.c
@@ -105,6 +105,8 @@ G_DEFINE_TYPE_WITH_CODE(SalutConnection,
        tp_presence_mixin_iface_init);
     G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_DBUS_PROPERTIES,
        tp_dbus_properties_mixin_iface_init);
+    G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS,
+       tp_contacts_mixin_iface_init);
     G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE,
        tp_presence_mixin_simple_presence_iface_init);
     G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_AVATARS,
@@ -273,6 +275,12 @@ salut_connection_constructor (GType type,
   obj = G_OBJECT_CLASS (salut_connection_parent_class)->
            constructor (type, n_props, props);
 
+  tp_contacts_mixin_init (obj,
+      G_STRUCT_OFFSET (SalutConnection, contacts_mixin));
+
+  tp_base_connection_register_with_contacts_mixin (TP_BASE_CONNECTION (obj));
+  tp_presence_mixin_simple_presence_register_with_contacts_mixin (obj);
+
   return obj;
 }
 
@@ -608,6 +616,9 @@ salut_connection_class_init (SalutConnectionClass *salut_connection_class)
 
   tp_presence_mixin_simple_presence_init_dbus_properties (object_class);
 
+  tp_contacts_mixin_class_init (object_class,
+        G_STRUCT_OFFSET (SalutConnectionClass, contacts_mixin));
+
   param_spec = g_param_spec_string ("nickname", "nickname",
       "Nickname used in the published data", NULL,
       G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB);
diff --git a/src/salut-connection.h b/src/salut-connection.h
index 8a2a718..f581ea4 100644
--- a/src/salut-connection.h
+++ b/src/salut-connection.h
@@ -28,6 +28,7 @@
 
 #include <telepathy-glib/enums.h>
 #include <telepathy-glib/base-connection.h>
+#include <telepathy-glib/contacts-mixin.h>
 #include <telepathy-glib/dbus-properties-mixin.h>
 #include <telepathy-glib/presence-mixin.h>
 #include <telepathy-glib/svc-connection.h>
@@ -43,11 +44,13 @@ struct _SalutConnectionClass {
   TpBaseConnectionClass parent_class;
   TpDBusPropertiesMixinClass properties_mixin;
   TpPresenceMixinClass presence_mixin;
+  TpContactsMixinClass contacts_mixin;
 };
 
 struct _SalutConnection {
   TpBaseConnection parent;
   TpPresenceMixin presence_mixin;
+  TpContactsMixin contacts_mixin;
 
   /* Our name on the network */
   gchar *name;
-- 
1.5.6.3




More information about the Telepathy-commits mailing list