comparison src/protocols/gg/gg.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 c0f68043854a
children 263c2db78f77
comparison
equal deleted inserted replaced
12969:b98a28bf29d9 12970:ec9b92104904
1381 return text; 1381 return text;
1382 } 1382 }
1383 } 1383 }
1384 /* }}} */ 1384 /* }}} */
1385 1385
1386 /* static char *ggp_tooltip_text(GaimBuddy *b, gboolean full) {{{ */ 1386 /* static void ggp_tooltip_text(GaimBuddy *b, GString *str, gboolean full) {{{ */
1387 static char *ggp_tooltip_text(GaimBuddy *b, gboolean full) 1387 static void ggp_tooltip_text(GaimBuddy *b, GString *str, gboolean full)
1388 { 1388 {
1389 GaimStatus *status; 1389 GaimStatus *status;
1390 char *text; 1390 char *text;
1391 gchar *ret;
1392 const char *msg, *name; 1391 const char *msg, *name;
1393 1392
1394 status = gaim_presence_get_active_status(gaim_buddy_get_presence(b)); 1393 status = gaim_presence_get_active_status(gaim_buddy_get_presence(b));
1395 msg = gaim_status_get_attr_string(status, "message"); 1394 msg = gaim_status_get_attr_string(status, "message");
1396 name = gaim_status_get_name(status); 1395 name = gaim_status_get_name(status);
1398 if (msg != NULL) { 1397 if (msg != NULL) {
1399 char *tmp = gaim_markup_strip_html(msg); 1398 char *tmp = gaim_markup_strip_html(msg);
1400 text = g_markup_escape_text(tmp, -1); 1399 text = g_markup_escape_text(tmp, -1);
1401 g_free(tmp); 1400 g_free(tmp);
1402 1401
1403 ret = g_strdup_printf("\n<b>%s:</b> %s: %s", 1402 g_string_append_printf(str, "\n<b>%s:</b> %s: %s",
1404 _("Status"), name, text); 1403 _("Status"), name, text);
1405 1404
1406 g_free(text); 1405 g_free(text);
1407 } else { 1406 } else {
1408 ret = g_strdup_printf("\n<b>%s:</b> %s", 1407 g_string_append_printf(str, "\n<b>%s:</b> %s",
1409 _("Status"), name); 1408 _("Status"), name);
1410 } 1409 }
1411
1412 return ret;
1413 } 1410 }
1414 /* }}} */ 1411 /* }}} */
1415 1412
1416 /* static GList *ggp_status_types(GaimAccount *account) {{{ */ 1413 /* static GList *ggp_status_types(GaimAccount *account) {{{ */
1417 static GList *ggp_status_types(GaimAccount *account) 1414 static GList *ggp_status_types(GaimAccount *account)