Update of /cvsroot/gaim/gaim/src
In directory sc8-pr-cvs1:/tmp/cvs-serv30741
Modified Files:
account.c account.h
Log Message:
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.
Index: account.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/account.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- account.c 4 Aug 2003 19:29:06 -0000 1.54
+++ account.c 4 Aug 2003 19:35:17 -0000 1.55
@@ -1260,11 +1260,35 @@
void
gaim_accounts_remove(GaimAccount *account)
{
+ GaimBlistNode *gnode, *bnode;
+
g_return_if_fail(account != NULL);
accounts = g_list_remove(accounts, account);
schedule_accounts_save();
+
+ for (gnode = gaim_get_blist()->root; gnode != NULL; gnode = gnode->next) {
+ if (!GAIM_BLIST_NODE_IS_GROUP(gnode))
+ continue;
+
+ for (bnode = gnode->child; bnode != NULL; bnode = bnode->next) {
+ if (GAIM_BLIST_NODE_IS_BUDDY(bnode)) {
+ struct buddy *b = (struct buddy *)bnode;
+
+ if (b->account == account)
+ gaim_blist_remove_buddy(b);
+ }
+ else if (GAIM_BLIST_NODE_IS_CHAT(bnode)) {
+ struct chat *c = (struct chat *)bnode;
+
+ if (c->account == account)
+ gaim_blist_remove_chat(c);
+ }
+ }
+ }
+
+ gaim_blist_save();
}
void
Index: account.h
===================================================================
RCS file: /cvsroot/gaim/gaim/src/account.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- account.h 20 Jul 2003 03:05:58 -0000 1.19
+++ account.h 4 Aug 2003 19:35:17 -0000 1.20
@@ -516,6 +516,9 @@
/**
* Removes an account from the list of accounts.
*
+ * This will remove any buddies from the buddy list that belong to this
+ * account.
+ *
* @param account The account.
*/
void gaim_accounts_remove(GaimAccount *account);
|