]> git.0d.be Git - empathy.git/commitdiff
allow got_list_channel to be called more than once for the same channel
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 24 Mar 2010 10:32:00 +0000 (11:32 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 30 Mar 2010 10:09:44 +0000 (12:09 +0200)
Also allow to pass other list channel such as 'deny' for example.

libempathy/empathy-tp-contact-list.c

index 2f2717b440979ad164c3f6cbc0385808d1e6d36e..1b8f116796e1545ab05fa5fa4a9bf20e08d6ebed 100644 (file)
@@ -710,19 +710,23 @@ got_list_channel (EmpathyTpContactList *list,
 
        /* TpChannel emits initial set of members just before being ready */
        if (!tp_strdiff (id, "stored")) {
+               if (priv->stored != NULL)
+                       return;
                priv->stored = g_object_ref (channel);
        } else if (!tp_strdiff (id, "publish")) {
+               if (priv->publish != NULL)
+                       return;
                priv->publish = g_object_ref (channel);
                g_signal_connect (priv->publish, "group-members-changed",
                                  G_CALLBACK (tp_contact_list_publish_group_members_changed_cb),
                                  list);
        } else if (!tp_strdiff (id, "subscribe")) {
+               if (priv->subscribe != NULL)
+                       return;
                priv->subscribe = g_object_ref (channel);
                g_signal_connect (priv->subscribe, "group-members-changed",
                                  G_CALLBACK (tp_contact_list_subscribe_group_members_changed_cb),
                                  list);
-       } else {
-               g_warn_if_reached ();
        }
 }