From 87452963e61f334f9880a41b153c916d197bc154 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Wed, 26 Dec 2012 02:25:08 +0100 Subject: [PATCH] Use nodepart in roster, if no other name exists --- src/gui/gtk/JubGtkRosterUI.m | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gui/gtk/JubGtkRosterUI.m b/src/gui/gtk/JubGtkRosterUI.m index c5163e1..06ffd28 100644 --- a/src/gui/gtk/JubGtkRosterUI.m +++ b/src/gui/gtk/JubGtkRosterUI.m @@ -133,7 +133,7 @@ static gboolean refilter_roster(gpointer data) struct add_roster_item_param { OFString *group; OFString *name; - OFString *jid; + XMPPJID *jid; OFMapTable *groupMap; OFMapTable *contactRows; GtkTreeStore *roster_model; @@ -173,8 +173,14 @@ static gboolean add_roster_item(gpointer user_data) // Create new contact row gtk_tree_store_append(params->roster_model, &contact_iter, &group_iter); - gtk_tree_store_set(params->roster_model, &contact_iter, - 0, [params->name UTF8String], 1, [params->jid UTF8String], -1); + if (params->name) + gtk_tree_store_set(params->roster_model, &contact_iter, + 0, [params->name UTF8String], + 1, [[params->jid bareJID] UTF8String], -1); + else + gtk_tree_store_set(params->roster_model, &contact_iter, + 0, [params->jid.node UTF8String], + 1, [[params->jid bareJID] UTF8String], -1); contact_path = gtk_tree_model_get_path(GTK_TREE_MODEL( params->roster_model), &contact_iter); @@ -264,7 +270,7 @@ static gboolean remove_roster_item(gpointer user_data) malloc(sizeof(*params)); params->group = [group retain]; params->name = [item.name retain]; - params->jid = [bareJID retain]; + params->jid = [item.JID retain]; params->groupMap = [groupMap retain]; params->contactRows = [contactRows retain]; params->roster_model = g_object_ref(roster_model); @@ -318,7 +324,7 @@ static gboolean remove_roster_item(gpointer user_data) malloc(sizeof(*params)); params->group = [group retain]; params->name = [item.name retain]; - params->jid = [[item.JID bareJID] retain]; + params->jid = [item.JID retain]; params->groupMap = [groupMap retain]; params->contactRows = [contactRows retain]; params->roster_model = g_object_ref(roster_model); -- 2.39.5