[telepathy-idle/master] Allow parting MUCs with RemoveMembers.

Will Thompson will.thompson at collabora.co.uk
Fri Aug 28 18:14:02 PDT 2009


Users of TpGroupMixin have to opt into this working for hysterical
raisins, but it works fine in Idle once we turn it on. Also hook up the
Group interface's D-Bus properties.
---
 src/idle-muc-channel.c                 |    3 +++
 tests/twisted/channels/requests-muc.py |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/idle-muc-channel.c b/src/idle-muc-channel.c
index fe6397e..5c732fe 100644
--- a/src/idle-muc-channel.c
+++ b/src/idle-muc-channel.c
@@ -297,6 +297,7 @@ static GObject *idle_muc_channel_constructor(GType type, guint n_props, GObjectC
 	dbus_g_connection_register_g_object(bus, priv->object_path, obj);
 
 	tp_group_mixin_init(obj, G_STRUCT_OFFSET(IdleMUCChannel, group), contact_handles, priv->connection->parent.self_handle);
+	tp_group_mixin_change_flags(obj, TP_CHANNEL_GROUP_FLAG_PROPERTIES, 0);
 
 	tp_text_mixin_init(obj, G_STRUCT_OFFSET(IdleMUCChannel, text), contact_handles);
 	tp_text_mixin_set_message_types(obj,
@@ -523,6 +524,8 @@ static void idle_muc_channel_class_init (IdleMUCChannelClass *idle_muc_channel_c
 
 	idle_muc_channel_class->dbus_props_class.interfaces = prop_interfaces;
 	tp_dbus_properties_mixin_class_init(object_class, G_STRUCT_OFFSET(IdleMUCChannelClass, dbus_props_class));
+	tp_group_mixin_init_dbus_properties (object_class);
+	tp_group_mixin_class_allow_self_removal (object_class);
 }
 
 void idle_muc_channel_dispose (GObject *object) {
diff --git a/tests/twisted/channels/requests-muc.py b/tests/twisted/channels/requests-muc.py
index a1191c2..1de8a85 100644
--- a/tests/twisted/channels/requests-muc.py
+++ b/tests/twisted/channels/requests-muc.py
@@ -89,7 +89,7 @@ def test(q, bus, conn, stream):
     assert chans[0] == (path, props)
 
     chan = make_channel_proxy(conn, path, 'Channel')
-    chan.Close()
+    chan.RemoveMembers([self_handle], "", dbus_interface=cs.CHANNEL_IFACE_GROUP)
 
     q.expect('stream-PART')
     stream.sendPart('#idletest', stream.nick)
-- 
1.5.6.5




More information about the telepathy-commits mailing list