diff src/protocols/yahoo/yahoo.c @ 4722:534eaa4ead94

[gaim-migrate @ 5034] Provided a generic way for prpls to put text in the second line of the Big List and removed a hideous Yahoo! buddy menu hack in the process committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 12 Mar 2003 06:37:40 +0000
parents e19f91053ad0
children b9e7ccf21f9c
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Wed Mar 12 02:27:28 2003 +0000
+++ b/src/protocols/yahoo/yahoo.c	Wed Mar 12 06:37:40 2003 +0000
@@ -1064,6 +1064,18 @@
 	open_url(NULL, url);
 	g_free(game);
 }
+
+static const char *yahoo_status_text(struct buddy *b)
+{
+	struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data;
+	if (b->uc & UC_UNAVAILABLE && b->uc >> 2 != YAHOO_STATUS_IDLE) {
+	       	if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM)
+			return yahoo_get_status_string(b->uc >> 2);
+		else
+			return g_hash_table_lookup(yd->hash, b->name);
+	}
+}
+
 static GList *yahoo_buddy_menu(struct gaim_connection *gc, char *who)
 {
 	GList *m = NULL;
@@ -1073,21 +1085,7 @@
 						  segfault and get the bug report. */
 	static char buf[1024];
 	static char buf2[1024];
-	
-	if (b->uc & UC_UNAVAILABLE && b->uc >> 2 != YAHOO_STATUS_IDLE) {
-		pbm = g_new0(struct proto_buddy_menu, 1);
-		if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM)
-			g_snprintf(buf, sizeof buf, 
-				   "Status: %s", yahoo_get_status_string(b->uc >> 2));
-		else
-			g_snprintf(buf, sizeof buf, "Custom Status: %s",
-				   (char *)g_hash_table_lookup(yd->hash, b->name));
-		pbm->label = buf;
-		pbm->callback = NULL;
-		pbm->gc = gc;
-		m = g_list_append(m, pbm);
-	}
-	
+
 	if (b->uc | YAHOO_STATUS_GAME) {
 		char *game = g_hash_table_lookup(yd->games, b->name);
 		char *room;
@@ -1111,7 +1109,7 @@
 			m = g_list_append(m, pbm);
 		}
 	}
-
+	
 	return m;
 }
 
@@ -1348,6 +1346,7 @@
 	ret->close = yahoo_close;
 	ret->buddy_menu = yahoo_buddy_menu;
 	ret->list_icon = yahoo_list_icon;
+	ret->status_text = yahoo_status_text;
 	ret->actions = yahoo_actions;
 	ret->send_im = yahoo_send_im;
 	ret->away_states = yahoo_away_states;