mirror of
https://github.com/anope/anope.git
synced 2026-07-10 04:23:13 +02:00
BUILD : 1.7.4 (277) BUGS : 131 NOTES : BotServ fantasy modified (module) buffer
git-svn-id: svn://svn.anope.org/anope/trunk@277 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@179 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
313417e92a
commit
e72a16bd71
+22
-6
@@ -185,15 +185,19 @@ void botmsgs(User * u, BotInfo * bi, char *buf)
|
||||
*
|
||||
*/
|
||||
|
||||
void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
void botchanmsgs(User * u, ChannelInfo * ci, char *buff)
|
||||
{
|
||||
int c;
|
||||
int16 cstatus = 0;
|
||||
char *cmd;
|
||||
char *cmd, *buf;
|
||||
UserData *ud;
|
||||
|
||||
buf = sstrdup(buff);
|
||||
|
||||
if (!u)
|
||||
if (!u) {
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Answer to ping if needed, without breaking the buffer. */
|
||||
if (!strnicmp(buf, "\1PING", 5))
|
||||
@@ -239,6 +243,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
if ((ci->botflags & BS_KICK_BOLDS) && strchr(buf, 2)) {
|
||||
check_ban(ci, u, TTB_BOLDS);
|
||||
bot_kick(ci, u, BOT_REASON_BOLD);
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -246,6 +251,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
if ((ci->botflags & BS_KICK_COLORS) && strchr(buf, 3)) {
|
||||
check_ban(ci, u, TTB_COLORS);
|
||||
bot_kick(ci, u, BOT_REASON_COLOR);
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -253,6 +259,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
if ((ci->botflags & BS_KICK_REVERSES) && strchr(buf, 22)) {
|
||||
check_ban(ci, u, TTB_REVERSES);
|
||||
bot_kick(ci, u, BOT_REASON_REVERSE);
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -260,6 +267,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
if ((ci->botflags & BS_KICK_UNDERLINES) && strchr(buf, 31)) {
|
||||
check_ban(ci, u, TTB_UNDERLINES);
|
||||
bot_kick(ci, u, BOT_REASON_UNDERLINE);
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -277,6 +285,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
if (i >= ci->capsmin && i * 100 / c >= ci->capspercent) {
|
||||
check_ban(ci, u, TTB_CAPS);
|
||||
bot_kick(ci, u, BOT_REASON_CAPS);
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -396,6 +405,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
bot_kick(ci, u, BOT_REASON_BADWORD_GENTLE);
|
||||
else
|
||||
bot_kick(ci, u, BOT_REASON_BADWORD, bw->word);
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -410,8 +420,10 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
time_t now = time(NULL);
|
||||
|
||||
ud = get_user_data(ci->c, u);
|
||||
if (!ud)
|
||||
if (!ud) {
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
if (now - ud->last_start > ci->floodsecs) {
|
||||
ud->last_start = time(NULL);
|
||||
@@ -422,6 +434,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
if (ud->lines >= ci->floodlines) {
|
||||
check_ban(ci, u, TTB_FLOOD);
|
||||
bot_kick(ci, u, BOT_REASON_FLOOD);
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -429,9 +442,10 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
/* Repeat kicker */
|
||||
if (ci->botflags & BS_KICK_REPEAT) {
|
||||
ud = get_user_data(ci->c, u);
|
||||
if (!ud)
|
||||
if (!ud) {
|
||||
free(buf);
|
||||
return;
|
||||
|
||||
}
|
||||
if (ud->lastline && stricmp(ud->lastline, buf)) {
|
||||
free(ud->lastline);
|
||||
ud->lastline = sstrdup(buf);
|
||||
@@ -445,6 +459,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
if (ud->times >= ci->repeattimes) {
|
||||
check_ban(ci, u, TTB_REPEAT);
|
||||
bot_kick(ci, u, BOT_REASON_REPEAT);
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -453,6 +468,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
|
||||
/* return if the user is on the ignore list */
|
||||
if (get_ignore(u->nick) != NULL) {
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -8,10 +8,14 @@
|
||||
VERSION_MAJOR="1"
|
||||
VERSION_MINOR="7"
|
||||
VERSION_PATCH="4"
|
||||
VERSION_BUILD="275"
|
||||
VERSION_BUILD="277"
|
||||
|
||||
# $Log$
|
||||
#
|
||||
# BUILD : 1.7.4 (277)
|
||||
# BUGS : 131
|
||||
# NOTES : BotServ fantasy modified (module) buffer
|
||||
#
|
||||
# BUILD : 1.7.4 (275)
|
||||
# BUGS : 126
|
||||
# NOTES : Fixed the 3rd mem leak identified in this bug report, i didnt find the first two however :/
|
||||
|
||||
Reference in New Issue
Block a user