Mercurial > pidgin.yaz
diff src/protocols/yahoo/yahoo.c @ 12970:ec9b92104904
[gaim-migrate @ 15323]
Pass the tooltip GString to the prpls. This make the prpl tooltip_text consistent with the drawing-tooltip signal callbacks. It also eliminates a little bit of duplicated code from the prpls. It's also theoretically more efficient, but I'm sure the difference is irrelevant. However, this change will allow me to kill a bunch more duplicated code.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Fri, 20 Jan 2006 20:35:18 +0000 |
parents | 6af3ac33eeea |
children | 6ea877c5a444 |
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c Fri Jan 20 17:24:54 2006 +0000 +++ b/src/protocols/yahoo/yahoo.c Fri Jan 20 20:35:18 2006 +0000 @@ -2778,11 +2778,10 @@ } } -char *yahoo_tooltip_text(GaimBuddy *b, gboolean full) +void yahoo_tooltip_text(GaimBuddy *b, GString *str, gboolean full) { YahooFriend *f; char *escaped, *status = NULL, *presence = NULL; - GString *s = g_string_new(""); f = yahoo_friend_find(b->account->gc, b->name); if (!f) @@ -2791,7 +2790,7 @@ switch (f->status) { case YAHOO_STATUS_CUSTOM: if (!yahoo_friend_get_status_message(f)) - return NULL; + return; status = g_strdup(yahoo_friend_get_status_message(f)); break; case YAHOO_STATUS_OFFLINE: @@ -2818,16 +2817,14 @@ if (status != NULL) { escaped = g_markup_escape_text(status, strlen(status)); - g_string_append_printf(s, _("\n<b>%s:</b> %s"), _("Status"), escaped); + g_string_append_printf(str, _("\n<b>%s:</b> %s"), _("Status"), escaped); g_free(status); g_free(escaped); } if (presence != NULL) - g_string_append_printf(s, _("\n<b>%s:</b> %s"), + g_string_append_printf(str, _("\n<b>%s:</b> %s"), _("Presence"), presence); - - return g_string_free(s, FALSE); } static void yahoo_addbuddyfrommenu_cb(GaimBlistNode *node, gpointer data)