aboutsummaryrefslogtreecommitdiffstats
path: root/account.c
diff options
context:
space:
mode:
Diffstat (limited to 'account.c')
-rw-r--r--account.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/account.c b/account.c
index f3e15d7e..f547d8f1 100644
--- a/account.c
+++ b/account.c
@@ -189,6 +189,7 @@ account_t *account_get( irc_t *irc, char *id )
void account_del( irc_t *irc, account_t *acc )
{
account_t *a, *l = NULL;
+ struct chat *c, *nc;
if( acc->ic )
/* Caller should have checked, accounts still in use can't be deleted. */
@@ -202,6 +203,13 @@ void account_del( irc_t *irc, account_t *acc )
else
irc->accounts = a->next;
+ for( c = irc->chatrooms; c; c = nc )
+ if( acc == c->acc )
+ {
+ nc = c->next;
+ chat_del( irc, c );
+ }
+
while( a->set )
set_del( &a->set, a->set->key );