diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-04 21:40:15 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-04 21:40:15 +0100 |
commit | 006a84f999248d1bc1c1e36fa3437765d4bd1142 (patch) | |
tree | d742fb55d2e7b021a83e660286cff1f29d9fb9bd /irc_channel.c | |
parent | f537044f96de6b6553f042e2274252cb834680b3 (diff) |
Kick the user instead of parting him/her when cleaning up a channel. This is
what the older version also did so that Irssi won't clean up the window.
Diffstat (limited to 'irc_channel.c')
-rw-r--r-- | irc_channel.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/irc_channel.c b/irc_channel.c index 4aec9077..70770bfb 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -118,7 +118,7 @@ int irc_channel_free( irc_channel_t *ic ) irc_t *irc = ic->irc; if( ic->flags & IRC_CHANNEL_JOINED ) - irc_channel_del_user( ic, irc->user, FALSE, "Cleaning up channel" ); + irc_channel_del_user( ic, irc->user, IRC_CDU_KICK, "Cleaning up channel" ); if( ic->f->_free ) ic->f->_free( ic ); @@ -222,7 +222,7 @@ int irc_channel_add_user( irc_channel_t *ic, irc_user_t *iu ) return 1; } -int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu, gboolean silent, const char *msg ) +int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu, irc_channel_del_user_type_t type, const char *msg ) { irc_channel_user_t *icu; @@ -232,8 +232,13 @@ int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu, gboolean silent, co ic->users = g_slist_remove( ic->users, icu ); g_free( icu ); - if( ic->flags & IRC_CHANNEL_JOINED && !silent ) + if( !( ic->flags & IRC_CHANNEL_JOINED ) || type == IRC_CDU_SILENT ) {} + /* Do nothing. The caller should promise it won't screw + up state of the IRC client. :-) */ + else if( type == IRC_CDU_PART ) irc_send_part( ic, iu, msg ); + else if( type == IRC_CDU_KICK ) + irc_send_kick( ic, iu, ic->irc->root, msg ); if( iu == ic->irc->user ) { |