From f898afc1d4e7bfae0ee8e3c5e6b7a0a0427fd6e3 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 14 Dec 2009 12:25:34 +0000 Subject: 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. --- libempathy/empathy-tp-contact-list.c | 3 +++ 1 file changed, 3 insertions(+) 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)); -- cgit v1.2.3