From: Thomas Sader Date: Tue, 15 Apr 2014 16:11:15 +0000 (+0200) Subject: channel: Don't trigger the CHANNEL_PART hook for ghost parts after a kick, the user... X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/01522d373a1a01ab123b9db2dc44c3cb23f6723b channel: Don't trigger the CHANNEL_PART hook for ghost parts after a kick, the user is already removed from the channel on kick. Found by Phiil. --- diff --git a/channel/channelhandlers.c b/channel/channelhandlers.c index ed512ad8..a42847bb 100644 --- a/channel/channelhandlers.c +++ b/channel/channelhandlers.c @@ -432,11 +432,13 @@ int handlepartmsg(void *source, int cargc, char **cargv) { /* Erm, parting a channel that's not there?? */ Error("channel",ERR_WARNING,"Nick %s left non-existent channel %s",np->nick,nextchan); } else { - /* Trigger hook *FIRST* */ - harg[0]=cp; - triggerhook(HOOK_CHANNEL_PART,harg); - - delnickfromchannel(cp,np->numeric,1); + /* Skip ghost parts (confirmation for kick from target server). */ + if (getnumerichandlefromchanhash(cp->users, np->numeric)) { + /* Trigger hook *FIRST* */ + harg[0]=cp; + triggerhook(HOOK_CHANNEL_PART,harg); + delnickfromchannel(cp,np->numeric,1); + } } nextchan=pos; }