diff src/protocols/msn/session.c @ 13905:4e44ecb866bd

[gaim-migrate @ 16394] msn_session_sync_users() iterates over the buddy list, following the ->next pointers of the groups, contacts, and buddies. msn_show_sync_issue(), if called, removed the buddy for which it was called, in preparation for the buddy either being added to the server list or confirmed-to-be-removed. This could lead to the buddy pointer being released and ->next therefore being junk. The buddy is now not removed until the user responds to the action dialog presented via msn_show_sync_issue(). I'm unclear why gtkgaim got away with this exercise in memory stomping but Adium/libgaim crashed every time, but it's safer in any case. I also changed some foo->bar to gaim_foo_get_bar(). committer: Tailor Script <tailor@pidgin.im>
author Evan Schoenberg <evan.s@dreskin.net>
date Sun, 02 Jul 2006 09:37:25 +0000
parents 510b7b7dd645
children
line wrap: on
line diff
--- a/src/protocols/msn/session.c	Sat Jul 01 23:21:12 2006 +0000
+++ b/src/protocols/msn/session.c	Sun Jul 02 09:37:25 2006 +0000
@@ -231,7 +231,7 @@
 	 * being logged in. This no longer happens, so we manually iterate
 	 * over the whole buddy list to identify sync issues. */
 
-	for (gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) {
+	for (gnode = gaim_blist_get_root(); gnode; gnode = gnode->next) {
 		GaimGroup *group = (GaimGroup *)gnode;
 		const char *group_name = group->name;
 		if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
@@ -244,11 +244,11 @@
 				if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
 					continue;
 				b = (GaimBuddy *)bnode;
-				if(b->account == gc->account) {
+				if(gaim_buddy_get_account(b) == gaim_connection_get_account(gc)) {
 					MsnUser *remote_user;
 					gboolean found = FALSE;
 
-					remote_user = msn_userlist_find_user(session->userlist, b->name);
+					remote_user = msn_userlist_find_user(session->userlist, gaim_buddy_get_name(b));
 
 					if ((remote_user != NULL) && (remote_user->list_op & MSN_LIST_FL_OP))
 					{
@@ -273,7 +273,7 @@
 					{
 						/* The user was not on the server list or not in that group
 						 * on the server list */
-						msn_show_sync_issue(session, b->name, group_name);
+						msn_show_sync_issue(session, gaim_buddy_get_name(b), group_name);
 					}
 				}
 			}