aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-22 22:30:55 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-22 23:22:00 +0800
commita2060ed1cebe60f382383178c7fd10c9ad8ffba4 (patch)
treea80c5d29168dfdf9f553592661934a6aa2495876
parentb6984f0d3afa9241ede62496d6a65e0d86fd0f8b (diff)
downloadgsoc2013-empathy-a2060ed1cebe60f382383178c7fd10c9ad8ffba4.tar
gsoc2013-empathy-a2060ed1cebe60f382383178c7fd10c9ad8ffba4.tar.gz
gsoc2013-empathy-a2060ed1cebe60f382383178c7fd10c9ad8ffba4.tar.bz2
gsoc2013-empathy-a2060ed1cebe60f382383178c7fd10c9ad8ffba4.tar.lz
gsoc2013-empathy-a2060ed1cebe60f382383178c7fd10c9ad8ffba4.tar.xz
gsoc2013-empathy-a2060ed1cebe60f382383178c7fd10c9ad8ffba4.tar.zst
gsoc2013-empathy-a2060ed1cebe60f382383178c7fd10c9ad8ffba4.zip
LogWindow: show "Chat with <MUC>" for MUCs
Instead of "Chat with <someone>", 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
-rw-r--r--libempathy-gtk/empathy-log-window.c16
1 files 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 <room>". */
+ 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,