From a2060ed1cebe60f382383178c7fd10c9ad8ffba4 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Wed, 22 Jun 2011 15:30:55 +0100 Subject: LogWindow: show "Chat with " for MUCs Instead of "Chat with ", which is confusing as there may be (and most likely there are) many people in the room. https://bugzilla.gnome.org/show_bug.cgi?id=653175 --- libempathy-gtk/empathy-log-window.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index b01cabed5..eaeab9d12 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -605,13 +605,25 @@ model_is_parent (GtkTreeModel *model, } static const gchar * -get_contact_alias_for_message (EmpathyMessage *message) +get_contact_alias_for_message (EmpathyMessage *message, + TplEvent *event) { EmpathyContact *sender, *receiver; + TplEntity *ent_sender, *ent_receiver; sender = empathy_message_get_sender (message); receiver = empathy_message_get_receiver (message); + ent_sender = tpl_event_get_sender (event); + ent_receiver = tpl_event_get_receiver (event); + + /* If this is a MUC, we want to show "Chat with ". */ + if (tpl_entity_get_entity_type (ent_sender) == TPL_ENTITY_ROOM) + return tpl_entity_get_alias (ent_sender); + if (ent_receiver && + tpl_entity_get_entity_type (ent_receiver) == TPL_ENTITY_ROOM) + return tpl_entity_get_alias (ent_receiver); + if (empathy_contact_is_user (sender)) return empathy_contact_get_alias (receiver); @@ -656,7 +668,7 @@ get_parent_iter_for_message (TplEvent *event, C_("A date with the time", "%A, %e %B %Y %X")); body = g_markup_printf_escaped (_("Chat with %s"), - get_contact_alias_for_message (message)); + get_contact_alias_for_message (message, event)); gtk_tree_store_append (store, &iter, NULL); gtk_tree_store_set (store, &iter, -- cgit v1.2.3 From 2b92c53540d0a3f7570f06850ad01e611c1704b6 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Wed, 22 Jun 2011 16:05:40 +0100 Subject: LogWindow: display the user id in a tooltip in the Who pane https://bugzilla.gnome.org/show_bug.cgi?id=573652 --- libempathy-gtk/empathy-log-window.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index eaeab9d12..a75e25491 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -154,6 +154,7 @@ enum COL_WHO_TYPE, COL_WHO_ICON, COL_WHO_NAME, + COL_WHO_ID, COL_WHO_ACCOUNT, COL_WHO_TARGET, COL_WHO_COUNT @@ -1339,6 +1340,7 @@ populate_entities_from_search_hits (void) COL_WHO_ICON, room ? EMPATHY_IMAGE_GROUP_MESSAGE : EMPATHY_IMAGE_AVATAR_DEFAULT, COL_WHO_NAME, tpl_entity_get_alias (hit->target), + COL_WHO_ID, tpl_entity_get_identifier (hit->target), COL_WHO_ACCOUNT, hit->account, COL_WHO_TARGET, hit->target, -1); @@ -1669,6 +1671,7 @@ log_manager_got_entities_cb (GObject *manager, COL_WHO_ICON, room ? EMPATHY_IMAGE_GROUP_MESSAGE : EMPATHY_IMAGE_AVATAR_DEFAULT, COL_WHO_NAME, tpl_entity_get_alias (entity), + COL_WHO_ID, tpl_entity_get_identifier (entity), COL_WHO_ACCOUNT, ctx->account, COL_WHO_TARGET, entity, -1); @@ -1968,6 +1971,7 @@ log_window_who_setup (EmpathyLogWindow *window) G_TYPE_INT, /* type */ G_TYPE_STRING, /* icon */ G_TYPE_STRING, /* name */ + G_TYPE_STRING, /* id */ TP_TYPE_ACCOUNT, /* account */ TPL_TYPE_ENTITY); /* target */ @@ -2008,6 +2012,7 @@ log_window_who_setup (EmpathyLogWindow *window) NULL, NULL); gtk_tree_view_set_search_column (view, COL_WHO_NAME); + gtk_tree_view_set_tooltip_column (view, COL_WHO_ID); /* set up signals */ g_signal_connect (selection, "changed", -- cgit v1.2.3