From 903885187ef029ef6a954f2dd338d5348ef5e307 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Fri, 9 Nov 2012 15:22:53 +0000 Subject: muc-channel: implement get_interfaces vfunc I don't think this new API is a net improvement over making TpBaseChannel do the work of merging ->interfaces (which would involve zero code changes in CMs, and none of this stupid boilerplate for building a list of strings in every CM) but there we go. --- src/idle-muc-channel.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/idle-muc-channel.c b/src/idle-muc-channel.c index 5dc6373..d1c3e66 100644 --- a/src/idle-muc-channel.c +++ b/src/idle-muc-channel.c @@ -309,6 +309,20 @@ idle_muc_channel_fill_immutable_properties ( NULL); } +static GPtrArray * +idle_muc_channel_get_interfaces (TpBaseChannel *self) +{ + TpBaseChannelClass *parent_class = + TP_BASE_CHANNEL_CLASS (idle_muc_channel_parent_class); + GPtrArray *interfaces = parent_class->get_interfaces (self); + const gchar **interface; + + for (interface = muc_channel_interfaces; *interface != NULL; interface++) + g_ptr_array_add (interfaces, (gchar *) *interface); + + return interfaces; +} + static void idle_muc_channel_class_init (IdleMUCChannelClass *idle_muc_channel_class) { GObjectClass *object_class = G_OBJECT_CLASS (idle_muc_channel_class); TpBaseChannelClass *base_channel_class = TP_BASE_CHANNEL_CLASS (idle_muc_channel_class); @@ -336,11 +350,11 @@ static void idle_muc_channel_class_init (IdleMUCChannelClass *idle_muc_channel_c base_channel_class->channel_type = TP_IFACE_CHANNEL_TYPE_TEXT; base_channel_class->target_handle_type = TP_HANDLE_TYPE_ROOM; - base_channel_class->interfaces = muc_channel_interfaces; base_channel_class->close = idle_muc_channel_close; base_channel_class->fill_immutable_properties = idle_muc_channel_fill_immutable_properties; base_channel_class->get_object_path_suffix = idle_muc_channel_get_path_suffix; + base_channel_class->get_interfaces = idle_muc_channel_get_interfaces; param_spec = g_param_spec_string ( "server", "Room.Server", "always empty", -- cgit v1.2.3