aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-14 20:25:34 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-31 16:39:40 +0800
commitf898afc1d4e7bfae0ee8e3c5e6b7a0a0427fd6e3 (patch)
tree2f02c7a6c542e22f9d1be51ea1cc47b56c655cd9 /libempathy
parent821a05da92cf42b7d3971500575375e3f0308866 (diff)
downloadgsoc2013-empathy-f898afc1d4e7bfae0ee8e3c5e6b7a0a0427fd6e3.tar
gsoc2013-empathy-f898afc1d4e7bfae0ee8e3c5e6b7a0a0427fd6e3.tar.gz
gsoc2013-empathy-f898afc1d4e7bfae0ee8e3c5e6b7a0a0427fd6e3.tar.bz2
gsoc2013-empathy-f898afc1d4e7bfae0ee8e3c5e6b7a0a0427fd6e3.tar.lz
gsoc2013-empathy-f898afc1d4e7bfae0ee8e3c5e6b7a0a0427fd6e3.tar.xz
gsoc2013-empathy-f898afc1d4e7bfae0ee8e3c5e6b7a0a0427fd6e3.tar.zst
gsoc2013-empathy-f898afc1d4e7bfae0ee8e3c5e6b7a0a0427fd6e3.zip
got_added_members_cb: check if contact is already in the hash before adding it
empathy_tp_contact_factory_get_from_handles is async, so if the contact has already been added when it returns the contact objects there is no point to try to re-add it twice.
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-contact-list.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index 8b35f2745..8cc1edcf9 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -397,6 +397,9 @@ got_added_members_cb (EmpathyTpContactFactory *factory,
EmpathyContact *contact = contacts[i];
TpHandle handle = empathy_contact_get_handle (contact);
+ if (g_hash_table_lookup (priv->members, GUINT_TO_POINTER (handle)))
+ continue;
+
/* Add to the list and emit signal */
g_hash_table_insert (priv->members, GUINT_TO_POINTER (handle),
g_object_ref (contact));