Add 1 second penalty for every further target on PRIVMSG/NOTICE
authorAlexander Barton <alex@barton.de>
Wed, 4 Jan 2012 20:43:32 +0000 (21:43 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 4 Jan 2012 20:46:58 +0000 (21:46 +0100)
This reduces the possibility of flooding channels with commands like
"PRIVMSG/NOTICE #a,#n,#c,... :message" a little bit.

Problem noticed by Cahata -- thanks!

src/ngircd/irc.c

index 69dd61a797994886c63bf0426a6d4434192a993c..7a871379a422543c416a111e6d2eeaafdd661dc5 100644 (file)
@@ -494,6 +494,8 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
                }
 
                currentTarget = strtok_r(NULL, ",", &lastCurrentTarget);
+               if (currentTarget)
+                       Conn_SetPenalty(Client_Conn(Client), 1);
        }
 
        return CONNECTED;