comparison 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
comparison
equal deleted inserted replaced
13904:863feae7fefa 13905:4e44ecb866bd
229 229
230 /* The core used to use msn_add_buddy to add all buddies before 230 /* The core used to use msn_add_buddy to add all buddies before
231 * being logged in. This no longer happens, so we manually iterate 231 * being logged in. This no longer happens, so we manually iterate
232 * over the whole buddy list to identify sync issues. */ 232 * over the whole buddy list to identify sync issues. */
233 233
234 for (gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { 234 for (gnode = gaim_blist_get_root(); gnode; gnode = gnode->next) {
235 GaimGroup *group = (GaimGroup *)gnode; 235 GaimGroup *group = (GaimGroup *)gnode;
236 const char *group_name = group->name; 236 const char *group_name = group->name;
237 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) 237 if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
238 continue; 238 continue;
239 for(cnode = gnode->child; cnode; cnode = cnode->next) { 239 for(cnode = gnode->child; cnode; cnode = cnode->next) {
242 for(bnode = cnode->child; bnode; bnode = bnode->next) { 242 for(bnode = cnode->child; bnode; bnode = bnode->next) {
243 GaimBuddy *b; 243 GaimBuddy *b;
244 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) 244 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
245 continue; 245 continue;
246 b = (GaimBuddy *)bnode; 246 b = (GaimBuddy *)bnode;
247 if(b->account == gc->account) { 247 if(gaim_buddy_get_account(b) == gaim_connection_get_account(gc)) {
248 MsnUser *remote_user; 248 MsnUser *remote_user;
249 gboolean found = FALSE; 249 gboolean found = FALSE;
250 250
251 remote_user = msn_userlist_find_user(session->userlist, b->name); 251 remote_user = msn_userlist_find_user(session->userlist, gaim_buddy_get_name(b));
252 252
253 if ((remote_user != NULL) && (remote_user->list_op & MSN_LIST_FL_OP)) 253 if ((remote_user != NULL) && (remote_user->list_op & MSN_LIST_FL_OP))
254 { 254 {
255 int group_id; 255 int group_id;
256 GList *l; 256 GList *l;
271 271
272 if (!found) 272 if (!found)
273 { 273 {
274 /* The user was not on the server list or not in that group 274 /* The user was not on the server list or not in that group
275 * on the server list */ 275 * on the server list */
276 msn_show_sync_issue(session, b->name, group_name); 276 msn_show_sync_issue(session, gaim_buddy_get_name(b), group_name);
277 } 277 }
278 } 278 }
279 } 279 }
280 } 280 }
281 } 281 }