diff libpurple/protocols/toc/toc.c @ 15462:0b6f337a46d5

Emblems in the blist
author Sean Egan <seanegan@gmail.com>
date Tue, 30 Jan 2007 06:53:23 +0000
parents 21bc8d84974f
children 32c366eeeb99
line wrap: on
line diff
--- a/libpurple/protocols/toc/toc.c	Tue Jan 30 05:27:44 2007 +0000
+++ b/libpurple/protocols/toc/toc.c	Tue Jan 30 06:53:23 2007 +0000
@@ -1515,28 +1515,15 @@
 	return "aim";
 }
 
-static void toc_list_emblems(GaimBuddy *b, const char **se, const char **sw, const char **nw, const char **ne)
+static const char* toc_list_emblem(GaimBuddy *b)
 {
-	char *emblems[4] = {NULL,NULL,NULL,NULL};
-	int i = 0;
-
-	if (!GAIM_BUDDY_IS_ONLINE(b)) {
-		*se = "offline";
-		return;
-	} else {
-		if (b->uc & UC_UNAVAILABLE)
-			emblems[i++] = "away";
-		if (b->uc & UC_AOL)
-			emblems[i++] = "aol";
-		if (b->uc & UC_ADMIN)
-			emblems[i++] = "admin";
-		if (b->uc & UC_WIRELESS)
-			emblems[i++] = "wireless";
-	}
-	*se = emblems[0];
-	*sw = emblems[1];
-	*nw = emblems[2];
-	*ne = emblems[3];
+	if (b->uc & UC_AOL)
+		return "aol";
+	if (b->uc & UC_ADMIN)
+		return "admin";
+	if (b->uc & UC_WIRELESS)
+		return "mobile";
+	return NULL	
 }
 
 static GList *toc_blist_node_menu(GaimBlistNode *node)
@@ -2243,7 +2230,7 @@
 	NULL,					/* protocol_options */
 	NO_BUDDY_ICONS,			/* icon_spec */
 	toc_list_icon,			/* list_icon */
-	toc_list_emblems,		/* list_emblems */
+	toc_list_emblem,		/* list_emblems */
 	NULL,					/* status_text */
 	NULL,					/* tooltip_text */
 	toc_away_states,		/* away_states */