about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2012-01-04 21:43:32 +0100
committerAlexander Barton <alex@barton.de>2012-01-04 21:46:58 +0100
commit6b62a5ec4f39238068b440fd7f6877582c54ec77 (patch)
tree1ccf52befdb75075e3d84079ed361b6212de4b54
parentb24d645ca183194b0158cd7bba1e0c1f468a7de9 (diff)
downloadngircd-6b62a5ec4f39238068b440fd7f6877582c54ec77.tar.gz
ngircd-6b62a5ec4f39238068b440fd7f6877582c54ec77.zip
Add 1 second penalty for every further target on PRIVMSG/NOTICE
This reduces the possibility of flooding channels with commands like
"PRIVMSG/NOTICE #a,#n,#c,... :message" a little bit.

Problem noticed by Cahata -- thanks!
-rw-r--r--src/ngircd/irc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c
index 69dd61a7..7a871379 100644
--- a/src/ngircd/irc.c
+++ b/src/ngircd/irc.c
@@ -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;