summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes1
-rw-r--r--src/botserv.c12
-rw-r--r--version.log6
3 files changed, 16 insertions, 3 deletions
diff --git a/Changes b/Changes
index 6873f981a..555e7d02f 100644
--- a/Changes
+++ b/Changes
@@ -19,6 +19,7 @@ Provided by Anope Dev. <dev@anope.org> - 2006
09/28 F We will now process UnrealIRCd's SVS(2)MODE messages. [#603]
09/29 F The 'nmake clean' on Windows now uses 'spotless' instead [ #00]
09/29 F Fixed a typo in Makefile.win32 [ #00]
+10/07 F BotServ KICK CAPS now only counts alphabetic chars for percentage.[#607]
Provided by Trystan <trystan@nomadirc.net> - 2006
08/20 F Fixed several compiler warnings. [#586]
diff --git a/src/botserv.c b/src/botserv.c
index 6b40ab3df..dd606952e 100644
--- a/src/botserv.c
+++ b/src/botserv.c
@@ -205,14 +205,22 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
if ((ci->botflags & BS_KICK_CAPS)
&& ((c = strlen(buf)) >= ci->capsmin)) {
int i = 0;
+ int l = 0;
char *s = buf;
do {
if (isupper(*s))
i++;
+ else if (islower(*s))
+ l++;
} while (*s++);
-
- if (i >= ci->capsmin && i * 100 / c >= ci->capspercent) {
+
+ /* i counts uppercase chars, l counts lowercase chars. Only
+ * alphabetic chars (so islower || isupper) qualify for the
+ * percentage of caps to kick for; the rest is ignored. -GD
+ */
+
+ if (i >= ci->capsmin && i * 100 / (i + l) >= ci->capspercent) {
check_ban(ci, u, TTB_CAPS);
bot_kick(ci, u, BOT_REASON_CAPS);
return;
diff --git a/version.log b/version.log
index 24713cff5..49cdaf1eb 100644
--- a/version.log
+++ b/version.log
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="15"
VERSION_EXTRA="-svn"
-VERSION_BUILD="1163"
+VERSION_BUILD="1164"
# $Log$
#
+# BUILD : 1.7.15 (1164)
+# BUGS : 607
+# NOTES : Fixed the BotServ CAPS-kicker; when calculating the percentage, it now ignores all non-alphabetic characters
+#
# BUILD : 1.7.15 (1163)
# BUGS :
# NOTES : Various small changes to documentation and example config (and removing void \r from sources)