diff src/protocols/yahoo/yahoo.c @ 4916:d9b6b5ae34e4

[gaim-migrate @ 5250] Buddy list editing. Does this work? I don't know; I don't test things. It compiles though. It probably does work though, because I'm perfect. So, see, I did really terribly in school last semester (really terribly-- like, why didn't they kick me out terribly) and so I'm working really hard to do well this semester (and I am so far :)). Anyway, that's why you may have noticed I'm a bit slow with the development of late. In fact, I would test and fix this stuff up, but I really need to work on an English paper, so I figured it'd be best just to commit it as is and let Rob, Nathan, Chip and the boys work out the kinks. Besides, I've had most of this code written for weeks already. Thank you all for your patience. Oh, so there's now an Edit menu on your buddy list (which makes the minimum buddy list width wider :-D) and here you'll find things with which to edit your list and privacy, prefs and accounts. It should all be real intuitive. Feel free to IM me if you want to talk about my paper. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 31 Mar 2003 07:19:46 +0000
parents 0ed37c803503
children f78b24df83d5
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Mon Mar 31 02:38:44 2003 +0000
+++ b/src/protocols/yahoo/yahoo.c	Mon Mar 31 07:19:46 2003 +0000
@@ -1015,15 +1015,27 @@
 {
 	return "yahoo";
 }
-/*
-  if ((uc >> 2) == YAHOO_STATUS_IDLE)
-  return status_idle_xpm;
-  else if (uc & UC_UNAVAILABLE)
-  return status_away_xpm;
-  else if (uc & YAHOO_STATUS_GAME)
-  return status_game_xpm;
-  return status_here_xpm;
-  }*/
+
+static void yahoo_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne)
+{
+	int i = 0;
+	char *emblems[4] = {NULL,NULL,NULL,NULL};
+	if (b->present == 0) {
+		*se = "offline";
+		return;
+	} else {
+		if ((b->uc >> 2) == YAHOO_STATUS_IDLE)
+			emblems[i++] = "idle";
+		if (b->uc & UC_UNAVAILABLE)
+			emblems[i++] = "away";
+		if (b->uc & YAHOO_STATUS_GAME)
+			emblems[i++] = "game";
+	}
+	*se = emblems[0];
+	*sw = emblems[1];
+	*nw = emblems[2];
+	*ne = emblems[3];
+}
 
 static char *yahoo_get_status_string(enum yahoo_status a)
 {
@@ -1380,6 +1392,7 @@
 	ret->close = yahoo_close;
 	ret->buddy_menu = yahoo_buddy_menu;
 	ret->list_icon = yahoo_list_icon;
+	ret->list_emblems = yahoo_list_emblems;
 	ret->status_text = yahoo_status_text;
 	ret->tooltip_text = yahoo_tooltip_text;
 	ret->actions = yahoo_actions;