diff src/protocols/jabber/jabber.c @ 4687:283fb289c510

[gaim-migrate @ 4998] This is a new buddy list. Lots of things about it just Don't Work. I probably already know about those things, and you'd just be wasting my time in submitting a bug report about it. I decided that instead of getting it to all work perfectly before committing, that I'd get it in cvs, and slowly fix it with regular commits. That way, it's easier to keep track of things, and other developers can help. Plus, I'm getting pissed off at the buddy list and want it to die. It's kinda boring, and doing nothing but the buddy list for such a long time has just gotten me very bitter. After 0.60 is released later this week, Gaim will resume being fun. This week is going to be very stressful, though, I'm sure. Things you ought to know about this buddy list: - It crashes - It leaks - There's no way to edit the buddy list, or access offline buddies - Most of the menus and buttons and whatnot just plain ol' don't work. - Status icons are only implemented for AIM. That's mostly just because I'm lazy. As such, you may want to be wary of updating this. If you do decide to update this, you may want to learn "cvs update -D yesterday" as well :) All the art there is just placeholder art. You probably won't really have as many problems as it sounds like you will from reading this. This message is extra-negative to stress that I don't want to be bothered with complaints about something not working about it :). I'll repeat: If something doesn't work, I probably already know about it. If you want to actually help with something, I'd be delighted to have it. IM me. -s. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 10 Mar 2003 05:30:31 +0000
parents 3145c5c45877
children e19f91053ad0
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Mon Mar 10 04:51:10 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Mon Mar 10 05:30:31 2003 +0000
@@ -964,9 +964,9 @@
 {
 	struct buddy *b;
 
-	if ((b = find_buddy(gc->account, buddyname)) != NULL) {
+	if ((b = gaim_find_buddy(gc->account, buddyname)) != NULL) {
 		debug_printf("removing buddy [1]: %s\n", buddyname);
-		remove_buddy(b);
+		gaim_blist_remove_buddy(b);
 		gaim_blist_save();
 	}
 }
@@ -1519,7 +1519,7 @@
 			jc->b = cnv = serv_got_joined_chat(GJ_GC(gjc), i++, gjid->user);
 			jc->id = gaim_chat_get_id(GAIM_CHAT(jc->b));
 			jc->state = JCS_ACTIVE;
-		} else if ((b = find_buddy(GJ_GC(gjc)->account, buddy)) == NULL) {
+		} else if ((b = gaim_find_buddy(GJ_GC(gjc)->account, buddy)) == NULL) {
 			g_free(buddy);
 			gaim_jid_free(gjid);
 			return;
@@ -1624,7 +1624,7 @@
 		 * If we don't already have the buddy on *our* buddylist,
 		 * ask if we want him or her added.
 		 */
-		if(find_buddy(jap->gc->account, jap->user) == NULL) {
+		if(gaim_find_buddy(jap->gc->account, jap->user) == NULL) {
 			show_got_added(jap->gc, NULL, jap->user, NULL, NULL);
 		}
 	}
@@ -1771,14 +1771,19 @@
 	 * Add or remove a buddy?  Change buddy's alias or group?
 	 */
 	if (BUD_SUB_TO_PEND(sub, ask) || BUD_SUBD_TO(sub, ask)) {
-		if ((b = find_buddy(GJ_GC(gjc)->account, buddyname)) == NULL) {
+		if ((b = gaim_find_buddy(GJ_GC(gjc)->account, buddyname)) == NULL) {
+			struct buddy *b = gaim_buddy_new(GJ_GC(gjc)->account, buddyname, name ? name : NULL);
+			struct group *g;
+			if (groupname) {
+				if (!(g = gaim_find_group(groupname)))
+					g = gaim_group_new(groupname);
+			} else
+				g = gaim_group_new(_("Buddies"));
 			debug_printf("adding buddy [4]: %s\n", buddyname);
-			b = add_buddy(GJ_GC(gjc)->account,
-					groupname ? groupname : _("Buddies"), buddyname,
-					name ? name : buddyname);
+			gaim_blist_add_buddy(b, g, NULL);
 			gaim_blist_save();
 		} else {
-			struct group *c_grp = find_group_by_buddy(b);
+			struct group *c_grp = gaim_find_buddys_group(b);
 
 			/*
 			 * If the buddy's in a new group or his/her alias is changed...
@@ -1792,9 +1797,9 @@
 				/*
 				 * seems rude, but it seems to be the only way...
 				 */
-				remove_buddy(b);
-				b = add_buddy(GJ_GC(gjc)->account, groupname, buddyname,
-					name ? name : buddyname);
+				gaim_blist_remove_buddy(b);
+				b = gaim_buddy_new(GJ_GC(gjc)->account, buddyname, name ? name : NULL);
+				gaim_blist_add_buddy(b, gaim_find_group(groupname), NULL);
 				gaim_blist_save();
 				if(present) {
 					serv_got_update(GJ_GC(gjc), buddyname, 1, 0, signon, idle,
@@ -1802,7 +1807,7 @@
 				}
 			} else if(name != NULL && strcmp(b->alias, name)) {
 				g_snprintf(b->alias, sizeof(b->alias), "%s", name);
-				handle_buddy_rename(b, buddyname);
+				gaim_blist_rename_buddy(b, buddyname);
 				gaim_blist_save();
 			}
 		}
@@ -2494,7 +2499,7 @@
 		y = xmlnode_insert_tag(xmlnode_get_tag(x, "query"), "item");
 		xmlnode_put_attrib(y, "jid", realwho);
 
-		buddy = find_buddy(gc->account, realwho);
+		buddy = gaim_find_buddy(gc->account, realwho);
 
 		/*
 		 * See if there's an explict (new?) alias for the buddy or we can pull
@@ -2520,7 +2525,7 @@
 		 */
 		if(group && group[0] != '\0') {
 			my_group = group;
-		} else if((buddy_group = find_group_by_buddy(buddy)) != NULL) {
+		} else if((buddy_group = gaim_find_buddys_group(buddy)) != NULL) {
 			my_group = buddy_group->name;
 		}
 
@@ -2762,8 +2767,11 @@
 		g_hash_table_foreach(jd->buddies, set_invisible_to_buddy_status, (gpointer) invisible);
 }
 
-static char **jabber_list_icon(int uc)
+static const char *jabber_list_icon(struct gaim_account *a, struct buddy *b)
 {
+	return "jabber";
+}
+/*
 	switch (uc) {
 	case UC_AWAY:
 		return available_away_xpm;
@@ -2778,7 +2786,7 @@
 	default:
 		return available_xpm;
 	}
-}
+	}*/
 
 static GList *jabber_chat_info(struct gaim_connection *gc)
 {
@@ -2897,7 +2905,7 @@
 		jc->gjid = gjid;
 		jc->gc = gc;
 		((struct jabber_data *)gc->proto_data)->chats = g_slist_append(jcs, jc);
-		add_buddy(gc->account, _("Chats"), realwho, realwho);
+		//	add_buddy(gc->account, _("Chats"), realwho, realwho);
 	}
 
 	jc->state = JCS_PENDING;
@@ -3202,7 +3210,7 @@
 static GList *jabber_buddy_menu(struct gaim_connection *gc, char *who) {
 	GList *m = NULL;
 	struct proto_buddy_menu *pbm;
-	struct buddy *b = find_buddy(gc->account, who);
+	struct buddy *b = gaim_find_buddy(gc->account, who);
 
 	if(b->uc == UC_ERROR)
 	{