]> git.0d.be Git - empathy.git/commitdiff
Make empathy_contact_equal NULL-safe for the contact ID and use the ^ operator to...
authorXavier Claessens <xclaesse@src.gnome.org>
Mon, 7 Jul 2008 20:41:38 +0000 (20:41 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Mon, 7 Jul 2008 20:41:38 +0000 (20:41 +0000)
svn path=/trunk/; revision=1202

libempathy/empathy-contact.c

index aee3fac5c51eac32724c26c6fc4bf9c6351c613d..46aee93eaa230235c01eda441299956182e642c5 100644 (file)
@@ -718,7 +718,8 @@ empathy_contact_equal (gconstpointer v1,
        id_a = empathy_contact_get_id (EMPATHY_CONTACT (v1));
        id_b = empathy_contact_get_id (EMPATHY_CONTACT (v2));
 
-       return empathy_account_equal (account_a, account_b) && g_str_equal (id_a, id_b);
+       return empathy_account_equal (account_a, account_b) &&
+              !tp_strdiff (id_a, id_b);
 }
 
 guint
@@ -731,7 +732,8 @@ empathy_contact_hash (gconstpointer key)
        priv = GET_PRIV (EMPATHY_CONTACT (key));
 
        if (priv->hash == 0) {
-               priv->hash = empathy_account_hash (priv->account) + g_str_hash (priv->id);
+               priv->hash = empathy_account_hash (priv->account) ^
+                            g_str_hash (priv->id);
        }
 
        return priv->hash;