diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-01-04 16:26:04 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-01-04 16:26:04 +0000 |
commit | 58aefe4ef8d5d1194725f340e353de853b21bef6 (patch) | |
tree | 50f6ecba34d68a7cbd0a6ca3f0a729ef7d35b91a /src/im-channel.c | |
parent | c9779d896a77f96f8aa582113984ba722ff65eb0 (diff) | |
download | telepathy-salut-58aefe4ef8d5d1194725f340e353de853b21bef6.tar.gz |
Don't use sealed struct members
This exposes a bug in the tests: several tests assumed that tubes'
Interfaces would always come out in the same order, but the new APIs
we're using break that assumption. Fix that too.
Diffstat (limited to 'src/im-channel.c')
-rw-r--r-- | src/im-channel.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/im-channel.c b/src/im-channel.c index 7001cb75..d7a409be 100644 --- a/src/im-channel.c +++ b/src/im-channel.c @@ -52,11 +52,6 @@ G_DEFINE_TYPE_WITH_CODE (SalutImChannel, salut_im_channel, TP_TYPE_BASE_CHANNEL, tp_message_mixin_messages_iface_init); ); -static const gchar *salut_im_channel_interfaces[] = { - TP_IFACE_CHANNEL_INTERFACE_MESSAGES, - NULL -}; - /* properties */ enum { @@ -229,6 +224,16 @@ salut_im_channel_get_object_path_suffix (TpBaseChannel *chan) tp_base_channel_get_target_handle (chan)); } +static GPtrArray * +salut_im_channel_get_interfaces (TpBaseChannel *chan) +{ + GPtrArray *interfaces = TP_BASE_CHANNEL_CLASS (salut_im_channel_parent_class) + ->get_interfaces (chan); + + g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_MESSAGES); + return interfaces; +} + static void salut_im_channel_class_init (SalutImChannelClass *salut_im_channel_class) { @@ -246,7 +251,7 @@ salut_im_channel_class_init (SalutImChannelClass *salut_im_channel_class) object_class->set_property = salut_im_channel_set_property; base_class->channel_type = TP_IFACE_CHANNEL_TYPE_TEXT; - base_class->interfaces = salut_im_channel_interfaces; + base_class->get_interfaces = salut_im_channel_get_interfaces; base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT; base_class->close = salut_im_channel_close; base_class->fill_immutable_properties = |