diff options
author | Sjoerd Simons <sjoerd@luon.net> | 2008-06-16 11:33:14 +0000 |
---|---|---|
committer | Sjoerd Simons <sjoerd@luon.net> | 2008-06-16 11:33:14 +0000 |
commit | 960a9d86cf7537e38fda083bd1b243392f099c75 (patch) | |
tree | a508840e4c221191f42aa800b33f3a191b616017 /src | |
parent | cd533f0810b50de9a00f91dc8a6efed550489fd1 (diff) | |
download | telepathy-salut-960a9d86cf7537e38fda083bd1b243392f099c75.tar.gz |
Implement SimplePresence interface
20080616113314-93b9a-03108278ae1ca77b8abc3c5cc1a66a44858b47ea.gz
Diffstat (limited to 'src')
-rw-r--r-- | src/salut-connection.c | 13 | ||||
-rw-r--r-- | src/salut-connection.h | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/salut-connection.c b/src/salut-connection.c index c99fe964..a395639f 100644 --- a/src/salut-connection.c +++ b/src/salut-connection.c @@ -60,6 +60,7 @@ #include <telepathy-glib/handle-repo-static.h> #include <telepathy-glib/handle-repo.h> #include <telepathy-glib/interfaces.h> +#include <telepathy-glib/svc-generic.h> #include <gibber/gibber-namespaces.h> @@ -102,6 +103,10 @@ G_DEFINE_TYPE_WITH_CODE(SalutConnection, salut_connection_aliasing_service_iface_init); G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE, 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_SIMPLE_PRESENCE, + tp_presence_mixin_simple_iface_init); G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_AVATARS, salut_connection_avatar_service_iface_init); #ifdef ENABLE_OLPC @@ -412,7 +417,7 @@ static gboolean is_presence_status_available (GObject *obj, guint index) { - return (index >= 0 && index < SALUT_PRESENCE_NR_PRESENCES); + return (index >= 0 && index < SALUT_PRESENCE_OFFLINE); } static GHashTable * @@ -562,6 +567,7 @@ salut_connection_class_init (SalutConnectionClass *salut_connection_class) static const gchar *interfaces [] = { TP_IFACE_CONNECTION_INTERFACE_ALIASING, TP_IFACE_CONNECTION_INTERFACE_PRESENCE, + TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, TP_IFACE_CONNECTION_INTERFACE_AVATARS, #ifdef ENABLE_OLPC SALUT_IFACE_OLPC_BUDDY_INFO, @@ -592,11 +598,16 @@ salut_connection_class_init (SalutConnectionClass *salut_connection_class) salut_connection_start_connecting; tp_connection_class->interfaces_always_present = interfaces; + tp_dbus_properties_mixin_class_init (object_class, + G_STRUCT_OFFSET (SalutConnectionClass, properties_mixin)); + tp_presence_mixin_class_init (object_class, G_STRUCT_OFFSET (SalutConnectionClass, presence_mixin), is_presence_status_available, get_contact_statuses, set_own_status, presence_statuses); + tp_presence_mixin_simple_init_dbus_properties (object_class); + 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 bc3e7146..8a2a7187 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/dbus-properties-mixin.h> #include <telepathy-glib/presence-mixin.h> #include <telepathy-glib/svc-connection.h> @@ -40,6 +41,7 @@ typedef struct _SalutConnectionClass SalutConnectionClass; struct _SalutConnectionClass { TpBaseConnectionClass parent_class; + TpDBusPropertiesMixinClass properties_mixin; TpPresenceMixinClass presence_mixin; }; |