aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTravis Reitter <treitter@gmail.com>2010-07-10 08:06:57 +0800
committerTravis Reitter <treitter@gmail.com>2010-07-21 07:12:37 +0800
commitb2dd6cd0f905bc78c678ea1206de81193fcadebc (patch)
tree5d0c767de725238da14af69750a008e0d7f985c2
parent3f4a0ae03c0eee55bf84f413214f5c834308011b (diff)
downloadgsoc2013-empathy-b2dd6cd0f905bc78c678ea1206de81193fcadebc.tar
gsoc2013-empathy-b2dd6cd0f905bc78c678ea1206de81193fcadebc.tar.gz
gsoc2013-empathy-b2dd6cd0f905bc78c678ea1206de81193fcadebc.tar.bz2
gsoc2013-empathy-b2dd6cd0f905bc78c678ea1206de81193fcadebc.tar.lz
gsoc2013-empathy-b2dd6cd0f905bc78c678ea1206de81193fcadebc.tar.xz
gsoc2013-empathy-b2dd6cd0f905bc78c678ea1206de81193fcadebc.tar.zst
gsoc2013-empathy-b2dd6cd0f905bc78c678ea1206de81193fcadebc.zip
Also sort the IndividualStore by underlying protocol and account ID.
-rw-r--r--libempathy-gtk/empathy-individual-store.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index 5d7dff944..7c625e8ef 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -1191,6 +1191,8 @@ individual_store_contact_sort (FolksIndividual *individual_a,
FolksIndividual *individual_b)
{
gint ret_val;
+ EmpathyContact *contact_a = NULL, *contact_b = NULL;
+ TpAccount *account_a, *account_b;
g_return_val_if_fail (individual_a != NULL || individual_b != NULL, 0);
@@ -1201,14 +1203,33 @@ individual_store_contact_sort (FolksIndividual *individual_a,
if (ret_val != 0)
goto out;
- /* identifier */
- ret_val = g_utf8_collate (folks_individual_get_id (individual_a),
- folks_individual_get_id (individual_b));
+ contact_a = empathy_contact_dup_from_folks_individual (individual_a);
+ contact_b = empathy_contact_dup_from_folks_individual (individual_b);
+ account_a = empathy_contact_get_account (contact_a);
+ account_b = empathy_contact_get_account (contact_b);
+
+ /* protocol */
+ ret_val = g_strcmp0 (tp_account_get_protocol (account_a),
+ tp_account_get_protocol (account_b));
if (ret_val != 0)
goto out;
+ /* account ID */
+ ret_val = g_strcmp0 (tp_proxy_get_object_path (account_a),
+ tp_proxy_get_object_path (account_b));
+
+ if (ret_val != 0)
+ goto out;
+
+ /* identifier */
+ ret_val = g_utf8_collate (folks_individual_get_id (individual_a),
+ folks_individual_get_id (individual_b));
+
out:
+ tp_clear_object (&contact_a);
+ tp_clear_object (&contact_b);
+
return ret_val;
}