diff src/protocols/novell/novell.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 17901f14d46d
line wrap: on
line diff
--- a/src/protocols/novell/novell.c	Fri Jan 20 17:24:54 2006 +0000
+++ b/src/protocols/novell/novell.c	Fri Jan 20 20:35:18 2006 +0000
@@ -2817,8 +2817,8 @@
 	return "novell";
 }
 
-static char *
-novell_tooltip_text(GaimBuddy * buddy, gboolean full)
+static void
+novell_tooltip_text(GaimBuddy * buddy, GString * str, gboolean full)
 {
 	NMUserRecord *user_record = NULL;
 	GaimConnection *gc;
@@ -2829,11 +2829,11 @@
 	const char *text = NULL;
 
 	if (buddy == NULL)
-		return "";
+		return; 
 
 	gc = gaim_account_get_connection(buddy->account);
 	if (gc == NULL || (user = gc->proto_data) == NULL)
-		return "";
+		return;
 
 	if (GAIM_BUDDY_IS_ONLINE(buddy)) {
 		user_record = nm_find_user_record(user, buddy->name);
@@ -2863,17 +2863,15 @@
 			}
 
 			if (text)
-				ret_text = g_strdup_printf("\n<b>%s:</b> %s"
-										   "\n<b>%s:</b> %s",
-										   _("Status"), status_str,
-										   _("Message"), text);
+				g_string_append_printf(str, "\n<b>%s:</b> %s"
+										    "\n<b>%s:</b> %s",
+										    _("Status"), status_str,
+										    _("Message"), text);
 			else
-				ret_text = g_strdup_printf("\n<b>%s:</b> %s",
-										   _("Status"), status_str);
+				g_string_append_printf(str, "\n<b>%s:</b> %s",
+										    _("Status"), status_str);
 		}
 	}
-
-	return ret_text;
 }
 
 static void