summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-01-15 16:11:31 -0500
committerAdam <Adam@anope.org>2011-01-15 16:11:31 -0500
commitc669820481b8c431f4238d6b2d958e9dbfec411a (patch)
treeeaa7e25756bed697553db9529cb490dc954a73a3 /src
parentecc2fc6029567d1d2f4d02d36bf64216ae9a03ee (diff)
Added an amsg kicker
Diffstat (limited to 'src')
-rw-r--r--src/botserv.cpp12
-rw-r--r--src/language.cpp18
2 files changed, 25 insertions, 5 deletions
diff --git a/src/botserv.cpp b/src/botserv.cpp
index 6eaa330c9..78e29451a 100644
--- a/src/botserv.cpp
+++ b/src/botserv.cpp
@@ -16,9 +16,6 @@
static UserData *get_user_data(Channel *c, User *u);
-static void check_ban(ChannelInfo *ci, User *u, int ttbtype);
-static void bot_kick(ChannelInfo *ci, User *u, LanguageString message, ...);
-
E void moduleAddBotServCmds();
/*************************************************************************/
@@ -116,6 +113,11 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf)
Allow = true;
else if (ci->botflags.HasFlag(BS_DONTKICKVOICES) && ci->c->HasUserStatus(u, CMODE_VOICE))
Allow = true;
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnPrivmsg, OnPrivmsg(u, ci, realbuf, Allow));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
if (!check_access(u, ci, CA_NOKICK) && Allow)
{
@@ -452,7 +454,7 @@ static UserData *get_user_data(Channel *c, User *u)
* @param u The user
* @param ttbtype The type of bot kicker the user should be checked against
*/
-static void check_ban(ChannelInfo *ci, User *u, int ttbtype)
+void check_ban(ChannelInfo *ci, User *u, int ttbtype)
{
BanData *bd = get_ban_data(ci->c, u);
@@ -485,7 +487,7 @@ static void check_ban(ChannelInfo *ci, User *u, int ttbtype)
/* This makes a bot kick an user. Works somewhat like notice_lang in fact ;) */
-static void bot_kick(ChannelInfo *ci, User *u, LanguageString message, ...)
+void bot_kick(ChannelInfo *ci, User *u, LanguageString message, ...)
{
va_list args;
char buf[1024];
diff --git a/src/language.cpp b/src/language.cpp
index 2e2e3004b..f6a2d432e 100644
--- a/src/language.cpp
+++ b/src/language.cpp
@@ -1648,6 +1648,8 @@ const char *const language_strings[LANG_STRING_COUNT] = {
_("Don't use underlines on this channel!"),
/* BOT_REASON_ITALIC */
_("Don't use italics on this channel!"),
+ /* BOT_REASON_AMSGS */
+ _("Don't use AMSGs!"),
/* BOT_BOT_SYNTAX */
_("BOT ADD nick user host real\n"
"BOT CHANGE oldnick newnick [user [host [real]]]\n"
@@ -1910,6 +1912,13 @@ const char *const language_strings[LANG_STRING_COUNT] = {
"%d kicks for the same user."),
/* BOT_KICK_ITALICS_OFF */
_("Bot won't kick italics anymore."),
+ /* BOT_KICK_AMSGS_ON */
+ _("Bot will now kick for \002amsgs\002"),
+ /* BOT_KICK_AMSGS_ON_BAN */
+ _("Bot will not kick for \002amsgs\002, and will place a ban after\n"
+ "%d kicks for the same user."),
+ /* BOT_KICK_AMSGS_OFF */
+ _("Bot won't kick for \002amsgs\002 anymore."),
/* BOT_BADWORDS_SYNTAX */
_("BADWORDS channel {ADD|DEL|LIST|CLEAR} [word | entry-list] [SINGLE|START|END]"),
/* BOT_BADWORDS_DISABLED */
@@ -4948,6 +4957,7 @@ const char *const language_strings[LANG_STRING_COUNT] = {
" \n"
"Configures bot kickers. option can be one of:\n"
" \n"
+ " AMSGS Sets if the bot kicks for amsgs\n"
" BOLDS Sets if the bot kicks bolds\n"
" BADWORDS Sets if the bot kicks bad words\n"
" CAPS Sets if the bot kicks caps\n"
@@ -5041,6 +5051,14 @@ const char *const language_strings[LANG_STRING_COUNT] = {
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."),
+ /* BOT_HELP_KICK_AMSGS */
+ _("Syntax: \002KICK \037channel\037 AMSGS {\037ON|OFF\037} [\037ttb\037]\002\n"
+ "Sets the amsg kicker on or off. When enabled, the bot will\n"
+ "kick users who send the same message to multiple channels\n"
+ "where BotServ bots are.\n"
+ "Ttb is the number of times a user can be kicked\n"
+ "before it get banned. Don't give ttb to disable\n"
+ "the ban system once activated."),
/* BOT_HELP_BADWORDS */
_("Syntax: BADWORDS channel ADD word [SINGLE | START | END]\n"
" BADWORDS channel DEL {word | entry-num | list}\n"