1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 21:03:13 +02:00

BUILD : 1.7.2 (106) BUGS : NOTES : Added BSCaseSensitive directive for a cAsE sEnSiTiVe badword kicker.

git-svn-id: svn://svn.anope.org/anope/trunk@106 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@82 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b
2004-05-15 10:24:52 +00:00
parent ece1f27896
commit 8431d0515f
7 changed files with 63 additions and 13 deletions
+1
View File
@@ -1,6 +1,7 @@
Anope Version 1.7.x (will be renamed when next release is produced)
-------------------
Provided by Anope Dev. <dev@anope.org>
2004/05/15 Added BSCaseSensitive directive for a cAsE sEnSiTiVe badword kicker.
2004/05/14 Removed some illegal sizeof(void). Thanks to codemastr.
2004/05/14 Added +a/-a support for PTLink
2004/05/14 Fixed HELP LIST and LIST SYNTAX help messages ( #53 )
+5
View File
@@ -2,6 +2,11 @@ Anope Version 1.7.x (will be renamed when next release is produced)
-------------------
** ADDED CONFIGURATION DIRECTIVES **
# BSCaseSensitive [OPTIONAL]
# This option will make botserv use cAsE sEnSiTiVe checking for badwords
# BSCaseSensitive
# MSMemoReceipt [OPTIONAL]
# Allow the use of memo receipts for the following groups:
# 1 - Opers Only
+44 -12
View File
@@ -295,22 +295,36 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
if (!bw->in_use)
continue;
if (bw->type == BW_ANY && stristr(nbuf, bw->word)) {
if (bw->type == BW_ANY
&& ((BSCaseSensitive && strstr(nbuf, bw->word))
|| stristr(nbuf, bw->word))) {
mustkick = 1;
} else if (bw->type == BW_SINGLE) {
int len = strlen(bw->word);
if (!stricmp(nbuf, bw->word)) {
if ((BSCaseSensitive && strstr(nbuf, bw->word))
|| (!BSCaseSensitive
&& (!stricmp(nbuf, bw->word)))) {
mustkick = 1;
/* two next if are quite odd isn't it? =) */
} else if ((strchr(nbuf, ' ') == nbuf + len)
&& (stristr(nbuf, bw->word) == nbuf)) {
&&
((BSCaseSensitive
&& (strstr(nbuf, bw->word) == nbuf))
|| (!BSCaseSensitive
&& (stristr(nbuf, bw->word) ==
nbuf)))) {
mustkick = 1;
} else
if ((strrchr(nbuf, ' ') ==
nbuf + strlen(nbuf) - len - 1)
&& (stristr(nbuf, bw->word) ==
nbuf + strlen(nbuf) - len)) {
&&
((BSCaseSensitive
&& (strstr(nbuf, bw->word) ==
nbuf + strlen(nbuf) - len))
|| (!BSCaseSensitive
&& (stristr(nbuf, bw->word) ==
nbuf + strlen(nbuf) - len)))) {
mustkick = 1;
} else {
char *wordbuf = scalloc(len + 3, 1);
@@ -320,13 +334,18 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
wordbuf[len + 2] = '\0';
memcpy(wordbuf + 1, bw->word, len);
if (stristr(nbuf, wordbuf))
if ((BSCaseSensitive && (strstr(nbuf, wordbuf)))
|| (!BSCaseSensitive
&& (stristr(nbuf, wordbuf))))
mustkick = 1;
}
} else if (bw->type == BW_START) {
int len = strlen(bw->word);
if (!strnicmp(nbuf, bw->word, len)) {
if ((BSCaseSensitive
&& (!strncmp(nbuf, bw->word, len)))
|| (!BSCaseSensitive
&& (!strnicmp(nbuf, bw->word, len)))) {
mustkick = 1;
} else {
char *wordbuf = scalloc(len + 2, 1);
@@ -335,7 +354,9 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
wordbuf[0] = ' ';
wordbuf[len + 1] = '\0';
if (stristr(nbuf, wordbuf))
if ((BSCaseSensitive && (strstr(nbuf, wordbuf)))
|| (!BSCaseSensitive
&& (stristr(nbuf, wordbuf))))
mustkick = 1;
free(wordbuf);
@@ -343,8 +364,15 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
} else if (bw->type == BW_END) {
int len = strlen(bw->word);
if (!strnicmp
(nbuf + strlen(nbuf) - len, bw->word, len)) {
if ((BSCaseSensitive
&&
(!strncmp
(nbuf + strlen(nbuf) - len, bw->word, len)))
|| (!BSCaseSensitive
&&
(!strnicmp
(nbuf + strlen(nbuf) - len, bw->word,
len)))) {
mustkick = 1;
} else {
char *wordbuf = scalloc(len + 2, 1);
@@ -353,7 +381,9 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
wordbuf[len] = ' ';
wordbuf[len + 1] = '\0';
if (stristr(nbuf, wordbuf))
if ((BSCaseSensitive && (strstr(nbuf, wordbuf)))
|| (!BSCaseSensitive
&& (stristr(nbuf, wordbuf))))
mustkick = 1;
free(wordbuf);
@@ -2331,7 +2361,9 @@ static int do_badwords(User * u)
}
for (bw = ci->badwords, i = 0; i < ci->bwcount; bw++, i++) {
if (bw->word && !stricmp(bw->word, word)) {
if (bw->word &&
((BSCaseSensitive && (!strcmp(bw->word, word)))
|| (!BSCaseSensitive && (!stricmp(bw->word, word))))) {
notice_lang(s_BotServ, u, BOT_BADWORDS_ALREADY_EXISTS,
bw->word, ci->name);
return MOD_CONT;
+2
View File
@@ -218,6 +218,7 @@ int BSMinUsers;
int BSBadWordsMax;
int BSSmartJoin;
int BSGentleBWReason;
int BSCaseSensitive;
int HideStatsO;
int GlobalOnCycle;
@@ -374,6 +375,7 @@ Directive directives[] = {
{"BSDefGreet", {{PARAM_SET, PARAM_RELOAD, &BSDefGreet}}},
{"BSDefFantasy", {{PARAM_SET, PARAM_RELOAD, &BSDefFantasy}}},
{"BSDefSymbiosis", {{PARAM_SET, PARAM_RELOAD, &BSDefSymbiosis}}},
{"BSCaseSensitive", {{PARAM_SET, PARAM_RELOAD, &BSCaseSensitive}}},
{"BSGentleBWReason", {{PARAM_SET, PARAM_RELOAD, &BSGentleBWReason}}},
{"BSKeepData", {{PARAM_TIME, PARAM_RELOAD, &BSKeepData}}},
{"BSMinUsers", {{PARAM_POSINT, PARAM_RELOAD, &BSMinUsers}}},
+5
View File
@@ -1010,6 +1010,11 @@ BSKeepData 10m
BSGentleBWReason
# BSCaseSensitive [OPTIONAL]
# This option will make botserv use cAsE sEnSiTiVe checking for badwords
# BSCaseSensitive
###########################################################################
#
# HostServ configuration
+1
View File
@@ -354,6 +354,7 @@ E int BSMinUsers;
E int BSBadWordsMax;
E int BSSmartJoin;
E int BSGentleBWReason;
E int BSCaseSensitive;
E int HideStatsO;
E int GlobalOnCycle;
+5 -1
View File
@@ -8,11 +8,15 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="2"
VERSION_BUILD="104"
VERSION_BUILD="106"
VERSION_EXTRA=""
# $Log$
#
# BUILD : 1.7.2 (106)
# BUGS :
# NOTES : Added BSCaseSensitive directive for a cAsE sEnSiTiVe badword kicker.
#
# BUILD : 1.7.2 (104)
# BUGS :
# NOTES : Removed some illegal sizeof(void). Thanks to codemastr.