# HG changeset patch # User Nathan Walp # Date 1060019059 0 # Node ID 72bbe310ac77282a94c713c918a26689b85561e1 # Parent 07b30424146b1537591b482ff063276a2343d864 [gaim-migrate @ 6870] delete buddies when we delete an account (thanks Vann) and clean up some compiler warnings in the irc code (thanks Paco-Paco) committer: Tailor Script diff -r 07b30424146b -r 72bbe310ac77 src/account.c --- a/src/account.c Mon Aug 04 17:02:59 2003 +0000 +++ b/src/account.c Mon Aug 04 17:44:19 2003 +0000 @@ -147,6 +147,8 @@ void gaim_account_destroy(GaimAccount *account) { + GaimBlistNode *gnode, *bnode; + g_return_if_fail(account != NULL); gaim_debug(GAIM_DEBUG_INFO, "account", @@ -158,6 +160,25 @@ gaim_debug(GAIM_DEBUG_INFO, "account", "Continuing to destroy account %p\n", account); + /* Let's remove the buddies for this account, before they cause trouble */ + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for(bnode = gnode->child; bnode; 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(); + if (account->username != NULL) g_free(account->username); if (account->alias != NULL) g_free(account->alias); if (account->password != NULL) g_free(account->password); diff -r 07b30424146b -r 72bbe310ac77 src/protocols/irc/cmds.c --- a/src/protocols/irc/cmds.c Mon Aug 04 17:02:59 2003 +0000 +++ b/src/protocols/irc/cmds.c Mon Aug 04 17:44:19 2003 +0000 @@ -197,10 +197,12 @@ return 0; gc = gaim_account_get_connection(irc->account); buf = irc_format(irc, "vnv", "MODE", gaim_connection_get_display_name(gc), args[0]); + } else { + return 0; } + irc_send(irc, buf); g_free(buf); - return 0; } @@ -452,6 +454,8 @@ buf = irc_format(irc, "v:", "WALLOPS", args[0]); else if (!strcmp(cmd, "operwall")) buf = irc_format(irc, "v:", "OPERWALL", args[0]); + else + return 0; irc_send(irc, buf); g_free(buf);