diff libpurple/protocols/oscar/util.c @ 30373:4e804413b12b

Added a way to view the Visible/Invisible lists. The UI is kind of crippled, but that seems to be the best we can do with the notify API.
author ivan.komarov@soc.pidgin.im
date Tue, 29 Jun 2010 21:17:02 +0000
parents 7fd5df3f519e
children 2d4dd38c5db5
line wrap: on
line diff
--- a/libpurple/protocols/oscar/util.c	Mon Jun 28 20:02:12 2010 +0000
+++ b/libpurple/protocols/oscar/util.c	Tue Jun 29 21:17:02 2010 +0000
@@ -387,3 +387,27 @@
 
 	return g_string_free(cpy, FALSE);
 }
+
+gchar *
+oscar_format_buddies(GSList *buddies, const gchar *no_buddies_message)
+{
+	GSList *cur;
+	gchar *result, *tmp;
+	if (!buddies) {
+		return g_strdup_printf("<i>%s</i>", no_buddies_message);
+	}
+	result = g_strdup("");
+	for (cur = buddies; cur != NULL; cur = cur->next) {
+		PurpleBuddy *buddy = cur->data;
+		const gchar *bname = purple_buddy_get_name(buddy);
+		const gchar *alias = purple_buddy_get_alias_only(buddy);
+		if (alias) {
+			tmp = g_strdup_printf("%s%s (%s)<br>", result, bname, alias);
+		} else {
+			tmp = g_strdup_printf("%s%s<br>", result, bname);
+		}
+		g_free(result);
+		result = tmp;
+	}
+	return result;
+}
\ No newline at end of file