From 9052bc147b30a08c8df6799df09b01f922c10be7 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 1 Jul 2010 00:15:44 +0100 Subject: Flush channels when the user leaves them. Also, don't update a control channel if the user isn't in it. --- irc_channel.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'irc_channel.c') diff --git a/irc_channel.c b/irc_channel.c index a0aaaccf..b597e809 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -240,6 +240,16 @@ int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu, gboolean silent, co if( ic->flags & IRC_CHANNEL_TEMP ) irc_channel_free_soon( ic ); + else + { + /* Flush userlist now. The user won't see it anyway. */ + while( ic->users ) + { + g_free( ic->users->data ); + ic->users = g_slist_remove( ic->users, ic->users->data ); + } + irc_channel_add_user( ic, ic->irc->root ); + } } return 1; @@ -581,6 +591,7 @@ static gboolean control_channel_free( irc_channel_t *ic ) set_del( &ic->set, "account" ); set_del( &ic->set, "fill_by" ); set_del( &ic->set, "group" ); + set_del( &ic->set, "protocol" ); g_free( icc ); ic->data = NULL; -- cgit v1.2.3