From 6b98af0d53275cf8003a9c6c55afd9bbe5d270d6 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 7 Jul 2008 20:41:38 +0000 Subject: Make empathy_contact_equal NULL-safe for the contact ID and use the ^ operator to concat 2 hashs values instead of +. svn path=/trunk/; revision=1202 --- libempathy/empathy-contact.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index aee3fac5c..46aee93ea 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -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; -- cgit v1.2.3