Mercurial > pidgin.yaz
changeset 10992:2bda44d66641
[gaim-migrate @ 12830]
Try to get the prpl tooltip_text even if the buddy is logged off. This doesn't appear to cause any problems with the existing prpls, but I didn't exactly go over them with a fine tooth comb ... if you know what I mean.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 09 Jun 2005 04:42:27 +0000 |
parents | 1798ad0be460 |
children | b6ca6d3c5332 |
files | src/gtkblist.c src/protocols/yahoo/yahoo.c |
diffstat | 2 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkblist.c Thu Jun 09 04:38:10 2005 +0000 +++ b/src/gtkblist.c Thu Jun 09 04:42:27 2005 +0000 @@ -2760,7 +2760,7 @@ /* Logged In */ signon = gaim_presence_get_login_time(presence); - if (signon > 0) + if (GAIM_BUDDY_IS_ONLINE(b) && signon > 0) { tmp = gaim_str_seconds_to_string(time(NULL) - signon); g_string_append_printf(str, _("\n<b>Logged In:</b> %s"), tmp); @@ -2806,7 +2806,8 @@ if (!GAIM_BUDDY_IS_ONLINE(b)) { g_string_append_printf(str, _("\n<b>Status:</b> Offline")); } - else if (prpl_info && prpl_info->tooltip_text) + + if (prpl_info && prpl_info->tooltip_text) { /* Additional text from the PRPL */ const char *end;
--- a/src/protocols/yahoo/yahoo.c Thu Jun 09 04:38:10 2005 +0000 +++ b/src/protocols/yahoo/yahoo.c Thu Jun 09 04:42:27 2005 +0000 @@ -2662,7 +2662,7 @@ char *yahoo_tooltip_text(GaimBuddy *b) { YahooFriend *f; - char *escaped, *status, *stealth = NULL; + char *escaped, *status = NULL, *stealth = NULL; GString *s = g_string_new(""); f = yahoo_friend_find(b->account->gc, b->name); @@ -2681,6 +2681,8 @@ return NULL; status = g_strdup(yahoo_friend_get_status_message(f)); break; + case YAHOO_STATUS_OFFLINE: + break; default: status = g_strdup(yahoo_get_status_string(f->status)); break; @@ -2700,10 +2702,12 @@ } } - escaped = g_markup_escape_text(status, strlen(status)); - g_string_append_printf(s, _("\n<b>%s:</b> %s"), _("Status"), escaped); - g_free(status); - g_free(escaped); + if (status != NULL) { + escaped = g_markup_escape_text(status, strlen(status)); + g_string_append_printf(s, _("\n<b>%s:</b> %s"), _("Status"), escaped); + g_free(status); + g_free(escaped); + } if (stealth != NULL) g_string_append_printf(s, _("\n<b>%s:</b> %s"),