aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-24 18:32:00 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-30 18:09:44 +0800
commit4893de0412531c4cb0eb846cffc9fec8031d5a1d (patch)
treef1c34a2a7f06481a005e503a2add28c8976af64a
parent944632a01dd934666170583b87e970f32211f810 (diff)
downloadgsoc2013-empathy-4893de0412531c4cb0eb846cffc9fec8031d5a1d.tar
gsoc2013-empathy-4893de0412531c4cb0eb846cffc9fec8031d5a1d.tar.gz
gsoc2013-empathy-4893de0412531c4cb0eb846cffc9fec8031d5a1d.tar.bz2
gsoc2013-empathy-4893de0412531c4cb0eb846cffc9fec8031d5a1d.tar.lz
gsoc2013-empathy-4893de0412531c4cb0eb846cffc9fec8031d5a1d.tar.xz
gsoc2013-empathy-4893de0412531c4cb0eb846cffc9fec8031d5a1d.tar.zst
gsoc2013-empathy-4893de0412531c4cb0eb846cffc9fec8031d5a1d.zip
allow got_list_channel to be called more than once for the same channel
Also allow to pass other list channel such as 'deny' for example.
-rw-r--r--libempathy/empathy-tp-contact-list.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index 2f2717b44..1b8f11679 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -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 ();
}
}