diff src/protocols/jabber/jabber.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 0230df73f56a
children c0c6efda8151
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Mon Mar 31 02:38:44 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Mon Mar 31 07:19:46 2003 +0000
@@ -2648,6 +2648,7 @@
 	xmlnode_free(x);
 }
 
+#if 0  /* Faceprint!  Look here! */
 /*
  * Remove a buddy item from the roster entirely
  */
@@ -2666,6 +2667,7 @@
 		xmlnode_free(x);
 	}
 }
+#endif
 
 /*
  * Unsubscribe a buddy from our presence
@@ -2776,22 +2778,31 @@
 {
 	return "jabber";
 }
-/*
-	switch (uc) {
-	case UC_AWAY:
-		return available_away_xpm;
-	case UC_CHAT:
-		return available_chat_xpm;
-	case UC_XA:
-		return available_xa_xpm;
-	case UC_DND:
-		return available_dnd_xpm;
-	case UC_ERROR:
-		return available_error_xpm;
-	default:
-		return available_xpm;
+
+static void jabber_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne)
+{
+	if (b->present == 0) {
+		*se = "offline";
+	} else {
+		switch (b->uc) {
+		case UC_AWAY:
+			*se = "away";
+			break;
+		case UC_CHAT:
+			*se = "chat";
+			break;
+		case UC_XA:
+			*se = "extendedaway";
+			break;
+		case UC_DND:
+			*se = "dnd";
+			break;
+		case UC_ERROR:
+			*se = "error";
+			break;
+		}
 	}
-	}*/
+}
 
 static GList *jabber_chat_info(struct gaim_connection *gc)
 {
@@ -3284,6 +3295,12 @@
 			pbm->label = _("Temporarily Hide From");
 			pbm->callback = jabber_invisible_to_buddy;
 		}
+
+		pbm->gc = gc;
+		m = g_list_append(m, pbm);
+		pbm = g_new0(struct proto_buddy_menu, 1);
+		pbm->label = _("Cancel Presence Notification");
+		pbm->callback = jabber_unsubscribe_buddy_from_us;
 		pbm->gc = gc;
 		m = g_list_append(m, pbm);
 	}
@@ -3291,32 +3308,6 @@
 	return m;
 }
 
-/*
- * Jabber protocol-specific "edit buddy menu" item(s)
- */
-static GList *jabber_edit_buddy_menu(struct gaim_connection *gc, char *who) {
-	GList *m = NULL;
-	struct proto_buddy_menu *pbm;
-
-	pbm = g_new0(struct proto_buddy_menu, 1);
-	pbm->label = _("Get Info");
-	pbm->callback = jabber_get_info;
-	pbm->gc = gc;
-	m = g_list_append(m, pbm);
-	pbm = g_new0(struct proto_buddy_menu, 1);
-	pbm->label = _("Remove From Roster");
-	pbm->callback = jabber_remove_buddy_roster_item;
-	pbm->gc = gc;
-	m = g_list_append(m, pbm);
-	pbm = g_new0(struct proto_buddy_menu, 1);
-	pbm->label = _("Cancel Presence Notification");
-	pbm->callback = jabber_unsubscribe_buddy_from_us;
-	pbm->gc = gc;
-	m = g_list_append(m, pbm);
-
-	return m;
-}
-
 static GList *jabber_away_states(struct gaim_connection *gc) {
 	GList *m = NULL;
 
@@ -4219,12 +4210,12 @@
 	ret->options = OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_CHAT_TOPIC;
 	ret->name = g_strdup("Jabber");
 	ret->list_icon = jabber_list_icon;
+	ret->list_emblems = jabber_list_emblems;
 	ret->status_text = jabber_status_text;
 	ret->tooltip_text = jabber_tooltip_text;
 	ret->away_states = jabber_away_states;
 	ret->actions = jabber_actions;
 	ret->buddy_menu = jabber_buddy_menu;
-	ret->edit_buddy_menu = jabber_edit_buddy_menu;
 	ret->login = jabber_login;
 	ret->close = jabber_close;
 	ret->send_im = jabber_send_im;