From: Will Thompson Date: Sun, 7 Jun 2009 19:19:01 +0000 (+0100) Subject: Only show status in tooltip when it exists X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=fe0b029e662224a5218f09eeabb0a49739620740 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. --- diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index bf02c3cc..bb168b6b 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 ("%s (%s)\n%s", + markup = g_markup_printf_escaped ("%s (%s)", 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 ("%s (%s)", name,