diff options
Diffstat (limited to 'examples/cm/echo-message-parts/chan.c')
-rw-r--r-- | 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 7c1d8d450..47325793b 100644 --- a/examples/cm/echo-message-parts/chan.c +++ b/examples/cm/echo-message-parts/chan.c @@ -29,6 +29,8 @@ G_DEFINE_TYPE_WITH_CODE (ExampleEcho2Channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, tp_message_mixin_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) @@ -46,6 +48,8 @@ example_echo_2_channel_get_interfaces (TpBaseChannel *self) 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; }; @@ -173,6 +177,13 @@ finally: } } +static gboolean +send_chat_state (GObject *object, + TpChannelChatState state, + GError **error) +{ + return TRUE; +} static GObject * constructor (GType type, @@ -203,6 +214,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; } @@ -219,6 +232,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; |