[empathy] Only show status in tooltip when it exists
- From: Will Thompson <wjt src gnome org>
- To: svn-commits-list gnome org
- Subject: [empathy] Only show status in tooltip when it exists
- Date: Mon, 8 Jun 2009 04:42:23 -0400 (EDT)
commit fe0b029e662224a5218f09eeabb0a49739620740
Author: Will Thompson <will thompson collabora co uk>
Date: Sun Jun 7 20:19:01 2009 +0100
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.
---
src/empathy-chat-window.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index bf02c3c..bb168b6 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]