From 005b8cbca64b9b6d71cea5dcab3b53ed89849e13 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 30 Mar 2010 14:58:19 +0200 Subject: Use NewChannels signal to catch group channels (#614236) --- libempathy/empathy-tp-contact-list.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index cce5f8e1e..a4a948d79 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -699,21 +699,6 @@ tp_contact_list_store_group_members_changed_cb (TpChannel *channel, } } -static void -tp_contact_list_new_channel_cb (TpConnection *proxy, - const gchar *object_path, - const gchar *channel_type, - guint handle_type, - guint handle, - gboolean suppress_handler, - gpointer user_data, - GObject *list) -{ - tp_contact_list_group_add_channel (EMPATHY_TP_CONTACT_LIST (list), - object_path, channel_type, - handle_type, handle); -} - static void tp_contact_list_list_channels_cb (TpConnection *connection, const GPtrArray *channels, @@ -886,6 +871,18 @@ new_channels_cb (TpConnection *conn, got_list_channel (list, channel); g_object_unref (channel); } + else if (handle_type == TP_HANDLE_TYPE_GROUP) { + TpHandle handle; + + handle = tp_asv_get_uint32 (properties, + TP_IFACE_CHANNEL ".TargetHandle", NULL); + if (handle == 0) + return; + + tp_contact_list_group_add_channel (list, + path, TP_IFACE_CHANNEL_TYPE_CONTACT_LIST, + TP_HANDLE_TYPE_GROUP, handle); + } } } @@ -974,11 +971,6 @@ tp_contact_list_constructed (GObject *list) tp_contact_list_list_channels_cb, NULL, NULL, list); - - tp_cli_connection_connect_to_new_channel (priv->connection, - tp_contact_list_new_channel_cb, - NULL, NULL, - list, NULL); } static void -- cgit v1.2.3