aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2009-06-08 04:08:43 +0800
committerWill Thompson <will.thompson@collabora.co.uk>2009-06-08 04:08:43 +0800
commitcc548789733a60b077718c022b6b0e03fc793857 (patch)
tree4fd1b782ff9f8f8462adf4dfb4b8d748fd4d7652
parent32d9b5f6dced1d8a51daa5bdced9d2784c1f0698 (diff)
downloadgsoc2013-empathy-cc548789733a60b077718c022b6b0e03fc793857.tar
gsoc2013-empathy-cc548789733a60b077718c022b6b0e03fc793857.tar.gz
gsoc2013-empathy-cc548789733a60b077718c022b6b0e03fc793857.tar.bz2
gsoc2013-empathy-cc548789733a60b077718c022b6b0e03fc793857.tar.lz
gsoc2013-empathy-cc548789733a60b077718c022b6b0e03fc793857.tar.xz
gsoc2013-empathy-cc548789733a60b077718c022b6b0e03fc793857.tar.zst
gsoc2013-empathy-cc548789733a60b077718c022b6b0e03fc793857.zip
Don't repeat a tooltip format string
-rw-r--r--src/empathy-chat-window.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 41bd20e15..9c2dbc490 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -405,9 +405,10 @@ chat_window_update_chat_tab (EmpathyChat *chat)
EmpathyChatWindowPriv *priv;
EmpathyContact *remote_contact;
const gchar *name;
+ const gchar *id;
McAccount *account;
const gchar *subject;
- const gchar *status;
+ const gchar *status = NULL;
GtkWidget *widget;
GString *tooltip;
gchar *markup;
@@ -449,21 +450,19 @@ chat_window_update_chat_tab (EmpathyChat *chat)
tooltip = g_string_new (NULL);
if (remote_contact) {
- append_markup_printf (tooltip,
- "<b>%s</b><small> (%s)</small>",
- empathy_contact_get_id (remote_contact),
- mc_account_get_display_name (account));
-
+ id = empathy_contact_get_id (remote_contact);
status = empathy_contact_get_presence_message (remote_contact);
-
- if (!EMP_STR_EMPTY (status)) {
- append_markup_printf (tooltip, "\n<i>%s</i>", status);
- }
+ } else {
+ id = name;
}
- else {
- append_markup_printf (tooltip,
- "<b>%s</b><small> (%s)</small>", name,
- mc_account_get_display_name (account));
+
+ append_markup_printf (tooltip,
+ "<b>%s</b><small> (%s)</small>",
+ id,
+ mc_account_get_display_name (account));
+
+ if (!EMP_STR_EMPTY (status)) {
+ append_markup_printf (tooltip, "\n<i>%s</i>", status);
}
if (subject) {