comparison src/protocols/bonjour/bonjour.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 82e918444965
children 6332531e14a7
comparison
equal deleted inserted replaced
12969:b98a28bf29d9 12970:ec9b92104904
304 return g_strdup("Away"); 304 return g_strdup("Away");
305 305
306 return NULL; 306 return NULL;
307 } 307 }
308 308
309 static char * 309 static void
310 bonjour_tooltip_text(GaimBuddy *buddy, gboolean full) 310 bonjour_tooltip_text(GaimBuddy *buddy, GString *str, gboolean full)
311 { 311 {
312 GString *ret;
313 GaimPresence *presence; 312 GaimPresence *presence;
314 GaimStatus *status; 313 GaimStatus *status;
315 const char *status_description; 314 const char *status_description;
316 const char *message; 315 const char *message;
317 316
324 else if (gaim_presence_is_idle(presence)) 323 else if (gaim_presence_is_idle(presence))
325 status_description = _("Idle"); 324 status_description = _("Idle");
326 else 325 else
327 status_description = gaim_status_get_name(status); 326 status_description = gaim_status_get_name(status);
328 327
329 ret = g_string_new(""); 328 g_string_append_printf(str, _("\n<b>Status:</b> %s"), status_description);
330 g_string_append_printf(ret, _("\n<b>Status:</b> %s"), status_description);
331 if (message != NULL) 329 if (message != NULL)
332 g_string_append_printf(ret, _("\n<b>Message:</b> %s"), message); 330 g_string_append_printf(str, _("\n<b>Message:</b> %s"), message);
333
334 return g_string_free(ret, FALSE);
335 } 331 }
336 332
337 static gboolean 333 static gboolean
338 plugin_unload(GaimPlugin *plugin) 334 plugin_unload(GaimPlugin *plugin)
339 { 335 {