comparison src/account.c @ 6367:9fd154ca6a94

[gaim-migrate @ 6872] The buddy removal code on account deletion has been moved to gaim_accounts_remove(). I think this is more correct, but still wonder about having an API function for actually deleting an account... This should do though. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 04 Aug 2003 19:35:17 +0000
parents 773b8ce563f5
children 41e6d15f4687
comparison
equal deleted inserted replaced
6366:773b8ce563f5 6367:9fd154ca6a94
1258 } 1258 }
1259 1259
1260 void 1260 void
1261 gaim_accounts_remove(GaimAccount *account) 1261 gaim_accounts_remove(GaimAccount *account)
1262 { 1262 {
1263 GaimBlistNode *gnode, *bnode;
1264
1263 g_return_if_fail(account != NULL); 1265 g_return_if_fail(account != NULL);
1264 1266
1265 accounts = g_list_remove(accounts, account); 1267 accounts = g_list_remove(accounts, account);
1266 1268
1267 schedule_accounts_save(); 1269 schedule_accounts_save();
1270
1271 for (gnode = gaim_get_blist()->root; gnode != NULL; gnode = gnode->next) {
1272 if (!GAIM_BLIST_NODE_IS_GROUP(gnode))
1273 continue;
1274
1275 for (bnode = gnode->child; bnode != NULL; bnode = bnode->next) {
1276 if (GAIM_BLIST_NODE_IS_BUDDY(bnode)) {
1277 struct buddy *b = (struct buddy *)bnode;
1278
1279 if (b->account == account)
1280 gaim_blist_remove_buddy(b);
1281 }
1282 else if (GAIM_BLIST_NODE_IS_CHAT(bnode)) {
1283 struct chat *c = (struct chat *)bnode;
1284
1285 if (c->account == account)
1286 gaim_blist_remove_chat(c);
1287 }
1288 }
1289 }
1290
1291 gaim_blist_save();
1268 } 1292 }
1269 1293
1270 void 1294 void
1271 gaim_accounts_auto_login(const char *ui) 1295 gaim_accounts_auto_login(const char *ui)
1272 { 1296 {