comparison libpurple/account.c @ 25874:367b3ddcf5c3

propagate from branch 'im.pidgin.pidgin' (head 81aa401ac9855c99eb55a7cf91fa221860dee220) to branch 'im.pidgin.pidgin.next.minor' (head cf7b71a77c33c3e1d2f392c46d090fb936eb47b7)
author Richard Laager <rlaager@wiktel.com>
date Mon, 08 Dec 2008 17:57:09 +0000
parents eacf48c09ccc 0331bc480515
children 1260a3fb60f4
comparison
equal deleted inserted replaced
24705:6f41450584a7 25874:367b3ddcf5c3
2246 if (prpl_info) { 2246 if (prpl_info) {
2247 GList *cur, *groups = NULL; 2247 GList *cur, *groups = NULL;
2248 2248
2249 /* Make a list of what group each buddy is in */ 2249 /* Make a list of what group each buddy is in */
2250 for (cur = buddies; cur != NULL; cur = cur->next) { 2250 for (cur = buddies; cur != NULL; cur = cur->next) {
2251 PurpleBlistNode *node = cur->data; 2251 PurpleBuddy *buddy = cur->data;
2252 groups = g_list_append(groups, node->parent->parent); 2252 groups = g_list_append(groups, purple_buddy_get_group(buddy));
2253 } 2253 }
2254 2254
2255 if (prpl_info->add_buddies != NULL) 2255 if (prpl_info->add_buddies != NULL)
2256 prpl_info->add_buddies(gc, buddies, groups); 2256 prpl_info->add_buddies(gc, buddies, groups);
2257 else if (prpl_info->add_buddy != NULL) { 2257 else if (prpl_info->add_buddy != NULL) {
2497 purple_request_close_with_handle(account); 2497 purple_request_close_with_handle(account);
2498 2498
2499 purple_accounts_remove(account); 2499 purple_accounts_remove(account);
2500 2500
2501 /* Remove this account's buddies */ 2501 /* Remove this account's buddies */
2502 for (gnode = purple_blist_get_root(); gnode != NULL; gnode = gnode->next) { 2502 for (gnode = purple_blist_get_root();
2503 gnode != NULL;
2504 gnode = purple_blist_node_get_sibling_next(gnode))
2505 {
2503 if (!PURPLE_BLIST_NODE_IS_GROUP(gnode)) 2506 if (!PURPLE_BLIST_NODE_IS_GROUP(gnode))
2504 continue; 2507 continue;
2505 2508
2506 cnode = gnode->child; 2509 cnode = purple_blist_node_get_first_child(gnode);
2507 while (cnode) { 2510 while (cnode) {
2508 PurpleBlistNode *cnode_next = cnode->next; 2511 PurpleBlistNode *cnode_next = purple_blist_node_get_sibling_next(cnode);
2509 2512
2510 if(PURPLE_BLIST_NODE_IS_CONTACT(cnode)) { 2513 if(PURPLE_BLIST_NODE_IS_CONTACT(cnode)) {
2511 bnode = cnode->child; 2514 bnode = purple_blist_node_get_first_child(cnode);
2512 while (bnode) { 2515 while (bnode) {
2513 PurpleBlistNode *bnode_next = bnode->next; 2516 PurpleBlistNode *bnode_next = purple_blist_node_get_sibling_next(bnode);
2514 2517
2515 if (PURPLE_BLIST_NODE_IS_BUDDY(bnode)) { 2518 if (PURPLE_BLIST_NODE_IS_BUDDY(bnode)) {
2516 PurpleBuddy *b = (PurpleBuddy *)bnode; 2519 PurpleBuddy *b = (PurpleBuddy *)bnode;
2517 2520
2518 if (b->account == account) 2521 if (purple_buddy_get_account(b) == account)
2519 purple_blist_remove_buddy(b); 2522 purple_blist_remove_buddy(b);
2520 } 2523 }
2521 bnode = bnode_next; 2524 bnode = bnode_next;
2522 } 2525 }
2523 } else if (PURPLE_BLIST_NODE_IS_CHAT(cnode)) { 2526 } else if (PURPLE_BLIST_NODE_IS_CHAT(cnode)) {
2524 PurpleChat *c = (PurpleChat *)cnode; 2527 PurpleChat *c = (PurpleChat *)cnode;
2525 2528
2526 if (c->account == account) 2529 if (purple_chat_get_account(c) == account)
2527 purple_blist_remove_chat(c); 2530 purple_blist_remove_chat(c);
2528 } 2531 }
2529 cnode = cnode_next; 2532 cnode = cnode_next;
2530 } 2533 }
2531 } 2534 }