summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-11-09 15:22:53 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-11-09 15:26:25 +0000
commit903885187ef029ef6a954f2dd338d5348ef5e307 (patch)
treedd0b3048c39e2125325f7be4add2c0c87b9ea3ae
parent5c34b7d2f170ff5f9ee9bf3821ececf55608d0df (diff)
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.
-rw-r--r--src/idle-muc-channel.c16
1 files changed, 15 insertions, 1 deletions
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",