comparison src/account.c @ 6368:41e6d15f4687

[gaim-migrate @ 6873] Actually, I decided to move the code to delete an account into gaim_accounts_delete(). This way, gaim_accounts_{add,remove} can be used for simply manipulating the list... A function should really just do one thing right. gaim_accounts_delete() now handles the removal of an account from the list, the deletion of buddies, and the destroying of the account structure. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 04 Aug 2003 19:39:33 +0000
parents 9fd154ca6a94
children 70d5122bc3ff
comparison
equal deleted inserted replaced
6367:9fd154ca6a94 6368:41e6d15f4687
1258 } 1258 }
1259 1259
1260 void 1260 void
1261 gaim_accounts_remove(GaimAccount *account) 1261 gaim_accounts_remove(GaimAccount *account)
1262 { 1262 {
1263 g_return_if_fail(account != NULL);
1264
1265 accounts = g_list_remove(accounts, account);
1266
1267 schedule_accounts_save();
1268 }
1269
1270 void
1271 gaim_accounts_delete(GaimAccount *account)
1272 {
1263 GaimBlistNode *gnode, *bnode; 1273 GaimBlistNode *gnode, *bnode;
1264 1274
1265 g_return_if_fail(account != NULL); 1275 g_return_if_fail(account != NULL);
1266 1276
1267 accounts = g_list_remove(accounts, account); 1277 gaim_accounts_remove(account);
1268
1269 schedule_accounts_save();
1270 1278
1271 for (gnode = gaim_get_blist()->root; gnode != NULL; gnode = gnode->next) { 1279 for (gnode = gaim_get_blist()->root; gnode != NULL; gnode = gnode->next) {
1272 if (!GAIM_BLIST_NODE_IS_GROUP(gnode)) 1280 if (!GAIM_BLIST_NODE_IS_GROUP(gnode))
1273 continue; 1281 continue;
1274 1282
1287 } 1295 }
1288 } 1296 }
1289 } 1297 }
1290 1298
1291 gaim_blist_save(); 1299 gaim_blist_save();
1300
1301 gaim_account_destroy(account);
1292 } 1302 }
1293 1303
1294 void 1304 void
1295 gaim_accounts_auto_login(const char *ui) 1305 gaim_accounts_auto_login(const char *ui)
1296 { 1306 {