]> jfr.im git - irc/quakenet/newserv.git/commitdiff
channel: Don't trigger the CHANNEL_PART hook for ghost parts after a kick, the user...
authorThomas Sader <redacted>
Tue, 15 Apr 2014 16:11:15 +0000 (18:11 +0200)
committerThomas Sader <redacted>
Tue, 15 Apr 2014 16:11:15 +0000 (18:11 +0200)
channel/channelhandlers.c

index ed512ad88499c85d60c1d6c68aa90daa256598e4..a42847bbcb8722e83a6d66493385a0a5520693da 100644 (file)
@@ -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;
   }