| 2260 if (prpl_info) { |
2260 if (prpl_info) { |
| 2261 GList *cur, *groups = NULL; |
2261 GList *cur, *groups = NULL; |
| 2262 |
2262 |
| 2263 /* Make a list of what group each buddy is in */ |
2263 /* Make a list of what group each buddy is in */ |
| 2264 for (cur = buddies; cur != NULL; cur = cur->next) { |
2264 for (cur = buddies; cur != NULL; cur = cur->next) { |
| 2265 PurpleBlistNode *node = cur->data; |
2265 PurpleBuddy *buddy = cur->data; |
| 2266 groups = g_list_append(groups, node->parent->parent); |
2266 groups = g_list_append(groups, purple_buddy_get_group(buddy)); |
| 2267 } |
2267 } |
| 2268 |
2268 |
| 2269 if (prpl_info->add_buddies != NULL) |
2269 if (prpl_info->add_buddies != NULL) |
| 2270 prpl_info->add_buddies(gc, buddies, groups); |
2270 prpl_info->add_buddies(gc, buddies, groups); |
| 2271 else if (prpl_info->add_buddy != NULL) { |
2271 else if (prpl_info->add_buddy != NULL) { |
| 2511 purple_request_close_with_handle(account); |
2511 purple_request_close_with_handle(account); |
| 2512 |
2512 |
| 2513 purple_accounts_remove(account); |
2513 purple_accounts_remove(account); |
| 2514 |
2514 |
| 2515 /* Remove this account's buddies */ |
2515 /* Remove this account's buddies */ |
| 2516 for (gnode = purple_blist_get_root(); gnode != NULL; gnode = gnode->next) { |
2516 for (gnode = purple_blist_get_root(); |
| |
2517 gnode != NULL; |
| |
2518 gnode = purple_blist_node_get_sibling_next(gnode)) |
| |
2519 { |
| 2517 if (!PURPLE_BLIST_NODE_IS_GROUP(gnode)) |
2520 if (!PURPLE_BLIST_NODE_IS_GROUP(gnode)) |
| 2518 continue; |
2521 continue; |
| 2519 |
2522 |
| 2520 cnode = gnode->child; |
2523 cnode = purple_blist_node_get_first_child(gnode); |
| 2521 while (cnode) { |
2524 while (cnode) { |
| 2522 PurpleBlistNode *cnode_next = cnode->next; |
2525 PurpleBlistNode *cnode_next = purple_blist_node_get_sibling_next(cnode); |
| 2523 |
2526 |
| 2524 if(PURPLE_BLIST_NODE_IS_CONTACT(cnode)) { |
2527 if(PURPLE_BLIST_NODE_IS_CONTACT(cnode)) { |
| 2525 bnode = cnode->child; |
2528 bnode = purple_blist_node_get_first_child(cnode); |
| 2526 while (bnode) { |
2529 while (bnode) { |
| 2527 PurpleBlistNode *bnode_next = bnode->next; |
2530 PurpleBlistNode *bnode_next = purple_blist_node_get_sibling_next(bnode); |
| 2528 |
2531 |
| 2529 if (PURPLE_BLIST_NODE_IS_BUDDY(bnode)) { |
2532 if (PURPLE_BLIST_NODE_IS_BUDDY(bnode)) { |
| 2530 PurpleBuddy *b = (PurpleBuddy *)bnode; |
2533 PurpleBuddy *b = (PurpleBuddy *)bnode; |
| 2531 |
2534 |
| 2532 if (b->account == account) |
2535 if (purple_buddy_get_account(b) == account) |
| 2533 purple_blist_remove_buddy(b); |
2536 purple_blist_remove_buddy(b); |
| 2534 } |
2537 } |
| 2535 bnode = bnode_next; |
2538 bnode = bnode_next; |
| 2536 } |
2539 } |
| 2537 } else if (PURPLE_BLIST_NODE_IS_CHAT(cnode)) { |
2540 } else if (PURPLE_BLIST_NODE_IS_CHAT(cnode)) { |
| 2538 PurpleChat *c = (PurpleChat *)cnode; |
2541 PurpleChat *c = (PurpleChat *)cnode; |
| 2539 |
2542 |
| 2540 if (c->account == account) |
2543 if (purple_chat_get_account(c) == account) |
| 2541 purple_blist_remove_chat(c); |
2544 purple_blist_remove_chat(c); |
| 2542 } |
2545 } |
| 2543 cnode = cnode_next; |
2546 cnode = cnode_next; |
| 2544 } |
2547 } |
| 2545 } |
2548 } |