[next] telepathy-glib: Implement ChatState in test echo channel

Xavier Claessens xclaesse at kemper.freedesktop.org
Wed May 9 13:10:53 PDT 2012


Module: telepathy-glib
Branch: next
Commit: 0d47abe5e83cc44fdea982823d05cd7bd29ed6fe
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=0d47abe5e83cc44fdea982823d05cd7bd29ed6fe

Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date:   Mon Apr 30 13:28:26 2012 +0200

Implement ChatState in test echo channel

https://bugs.freedesktop.org/show_bug.cgi?id=49215

---

 examples/cm/echo-message-parts/chan.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/examples/cm/echo-message-parts/chan.c b/examples/cm/echo-message-parts/chan.c
index 73ddc8c..3d1d853 100644
--- a/examples/cm/echo-message-parts/chan.c
+++ b/examples/cm/echo-message-parts/chan.c
@@ -31,6 +31,8 @@ G_DEFINE_TYPE_WITH_CODE (ExampleEcho2Channel,
       tp_message_mixin_text_iface_init)
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_MESSAGES,
       tp_message_mixin_messages_iface_init)
+    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_CHAT_STATE,
+      tp_message_mixin_chat_state_iface_init)
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_DESTROYABLE,
       destroyable_iface_init)
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_SMS, sms_iface_init)
@@ -49,6 +51,8 @@ example_echo_2_channel_get_interfaces (TpBaseChannel *self)
   g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_MESSAGES);
   g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE);
   g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_SMS);
+  g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_CHAT_STATE);
+
   return interfaces;
 };
 
@@ -176,6 +180,13 @@ finally:
     }
 }
 
+static gboolean
+send_chat_state (GObject *object,
+    TpChannelChatState state,
+    GError **error)
+{
+  return TRUE;
+}
 
 static GObject *
 constructor (GType type,
@@ -206,6 +217,8 @@ constructor (GType type,
       TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES,
       content_types);
 
+  tp_message_mixin_implement_send_chat_state (object, send_chat_state);
+
   return object;
 }
 
@@ -222,6 +235,8 @@ example_echo_2_channel_close (TpBaseChannel *self)
 {
   GObject *object = (GObject *) self;
 
+  tp_message_mixin_maybe_send_gone (object);
+
   if (!tp_base_channel_is_destroyed (self))
     {
       TpHandle first_sender;



More information about the telepathy-commits mailing list