diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-01 00:15:44 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-01 00:15:44 +0100 |
commit | 9052bc147b30a08c8df6799df09b01f922c10be7 (patch) | |
tree | c285863ae1beed09ab135ded3b45342d516fbc4d | |
parent | d7f850037c6288b5a2eebae789ed0247d0e5f7b3 (diff) |
Flush channels when the user leaves them. Also, don't update a control
channel if the user isn't in it.
-rw-r--r-- | irc_channel.c | 11 | ||||
-rw-r--r-- | irc_im.c | 3 |
2 files changed, 13 insertions, 1 deletions
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; @@ -130,7 +130,8 @@ void bee_irc_channel_update( irc_t *irc, irc_channel_t *ic, irc_user_t *iu ) { ic = l->data; /* TODO: Just add a type flag or so.. */ - if( ic->f == irc->default_channel->f ) + if( ic->f == irc->default_channel->f && + ( ic->flags & IRC_CHANNEL_JOINED ) ) bee_irc_channel_update( irc, ic, iu ); } return; |