From 47fae0ffdda6ea4509ba00b56d15fb25ffe19eea Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 9 May 2010 13:05:50 +0100 Subject: No. Run the part handler from the IRC /PART command, not from irc_channel.c. This was causing troubles with Twitter at disconnect time. --- irc_channel.c | 4 ---- irc_commands.c | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/irc_channel.c b/irc_channel.c index 2c6601d2..528d0442 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -127,11 +127,7 @@ int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu ) irc_send_part( ic, iu, "" ); if( iu == ic->irc->user ) - { ic->flags &= ~IRC_CHANNEL_JOINED; - if( ic->f->part ) - ic->f->part( ic, NULL ); - } return 1; } diff --git a/irc_commands.c b/irc_commands.c index f56f45a0..e6954071 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -168,7 +168,12 @@ static void irc_cmd_part( irc_t *irc, char **cmd ) { irc_send_num( irc, 403, "%s :No such channel", cmd[1] ); } - else if( !irc_channel_del_user( ic, irc->user ) ) + else if( irc_channel_del_user( ic, irc->user ) ) + { + if( ic->f->part ) + ic->f->part( ic, NULL ); + } + else { irc_send_num( irc, 442, "%s :You're not on that channel", cmd[1] ); } -- cgit v1.2.3