diff 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
line wrap: on
line diff
--- a/src/account.c	Mon Aug 04 19:35:17 2003 +0000
+++ b/src/account.c	Mon Aug 04 19:39:33 2003 +0000
@@ -1260,13 +1260,21 @@
 void
 gaim_accounts_remove(GaimAccount *account)
 {
-	GaimBlistNode *gnode, *bnode;
-
 	g_return_if_fail(account != NULL);
 
 	accounts = g_list_remove(accounts, account);
 
 	schedule_accounts_save();
+}
+
+void
+gaim_accounts_delete(GaimAccount *account)
+{
+	GaimBlistNode *gnode, *bnode;
+
+	g_return_if_fail(account != NULL);
+
+	gaim_accounts_remove(account);
 
 	for (gnode = gaim_get_blist()->root; gnode != NULL; gnode = gnode->next) {
 		if (!GAIM_BLIST_NODE_IS_GROUP(gnode))
@@ -1289,6 +1297,8 @@
 	}
 
 	gaim_blist_save();
+
+	gaim_account_destroy(account);
 }
 
 void