aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2009-06-08 03:19:01 +0800
committerWill Thompson <will.thompson@collabora.co.uk>2009-06-08 03:19:01 +0800
commitfe0b029e662224a5218f09eeabb0a49739620740 (patch)
tree9a44f3d4b3ae407b42282a5e79abee574d4d75a9
parentb82e930d045ce65fc9bfb6529898349144101be8 (diff)
downloadgsoc2013-empathy-fe0b029e662224a5218f09eeabb0a49739620740.tar
gsoc2013-empathy-fe0b029e662224a5218f09eeabb0a49739620740.tar.gz
gsoc2013-empathy-fe0b029e662224a5218f09eeabb0a49739620740.tar.bz2
gsoc2013-empathy-fe0b029e662224a5218f09eeabb0a49739620740.tar.lz
gsoc2013-empathy-fe0b029e662224a5218f09eeabb0a49739620740.tar.xz
gsoc2013-empathy-fe0b029e662224a5218f09eeabb0a49739620740.tar.zst
gsoc2013-empathy-fe0b029e662224a5218f09eeabb0a49739620740.zip
Only show status in tooltip when it exists
empathy_contact_get_status () can return NULL: perhaps the protocol doesn't support presence, or perhaps we're not subscribed to the contact's presence.
-rw-r--r--src/empathy-chat-window.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index bf02c3cc6..bb168b6bb 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -390,6 +390,7 @@ chat_window_update_chat_tab (EmpathyChat *chat)
const gchar *name;
McAccount *account;
const gchar *subject;
+ const gchar *status;
GtkWidget *widget;
GString *tooltip;
gchar *markup;
@@ -431,12 +432,19 @@ chat_window_update_chat_tab (EmpathyChat *chat)
tooltip = g_string_new (NULL);
if (remote_contact) {
- markup = g_markup_printf_escaped ("<b>%s</b><small> (%s)</small>\n%s",
+ markup = g_markup_printf_escaped ("<b>%s</b><small> (%s)</small>",
empathy_contact_get_id (remote_contact),
- mc_account_get_display_name (account),
- empathy_contact_get_status (remote_contact));
+ mc_account_get_display_name (account));
g_string_append (tooltip, markup);
g_free (markup);
+
+ status = empathy_contact_get_status (remote_contact);
+
+ if (status) {
+ markup = g_markup_printf_escaped ("\n%s", status);
+ g_string_append (tooltip, markup);
+ g_free (markup);
+ }
}
else {
markup = g_markup_printf_escaped ("<b>%s</b><small> (%s)</small>", name,