summaryrefslogtreecommitdiff
path: root/modules/core
diff options
context:
space:
mode:
authorlethality <lethality@anope.org>2010-08-02 03:35:12 +0100
committerlethality <lethality@anope.org>2010-08-02 03:35:12 +0100
commit94371e69a9bf623442feb16cebe21b2ad71e6c2a (patch)
treeeb834f14d8f7ee0c29e448d14f597d186abe188e /modules/core
parentf887b37453ae55a4a61e0e7c6ee774f38dddfc2e (diff)
Added Italics support to the BotSev kickers
Diffstat (limited to 'modules/core')
-rw-r--r--modules/core/bs_info.cpp11
-rw-r--r--modules/core/bs_kick.cpp32
-rw-r--r--modules/core/db_plain.cpp5
3 files changed, 46 insertions, 2 deletions
diff --git a/modules/core/bs_info.cpp b/modules/core/bs_info.cpp
index 2f1dafb81..e03768759 100644
--- a/modules/core/bs_info.cpp
+++ b/modules/core/bs_info.cpp
@@ -157,7 +157,16 @@ class CommandBSInfo : public Command
}
else
notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES, getstring(u, BOT_INFO_INACTIVE));
-
+ if (ci->botflags.HasFlag(BS_KICK_ITALICS))
+ {
+ if (ci->ttb[TTB_ITALICS])
+ notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_ITALICS]);
+ else
+ notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS, getstring(u, BOT_INFO_ACTIVE));
+ }
+ else
+ notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS, getstring(u, BOT_INFO_INACTIVE));
+
end = buf;
*end = 0;
if (ci->botflags.HasFlag(BS_DONTKICKOPS))
diff --git a/modules/core/bs_kick.cpp b/modules/core/bs_kick.cpp
index cb0253874..6a4528b7e 100644
--- a/modules/core/bs_kick.cpp
+++ b/modules/core/bs_kick.cpp
@@ -331,6 +331,36 @@ class CommandBSKick : public Command
notice_lang(Config.s_BotServ, u, BOT_KICK_UNDERLINES_OFF);
}
}
+ else if (option.equals_ci("ITALICS"))
+ {
+ if (value.equals_ci("ON"))
+ {
+ if (!ttb.empty())
+ {
+ Anope::string error;
+ ci->ttb[TTB_ITALICS] = convertTo<int16>(ttb, error, false);
+ if (!error.empty() || ci->ttb[TTB_ITALICS] < 0)
+ {
+ Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_ITALICS];
+ ci->ttb[TTB_ITALICS] = 0;
+ notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str());
+ return MOD_CONT;
+ }
+ }
+ else
+ ci->ttb[TTB_ITALICS] = 0;
+ ci->botflags.SetFlag(BS_KICK_ITALICS);
+ if (ci->ttb[TTB_ITALICS])
+ notice_lang(Config.s_BotServ, u, BOT_KICK_ITALICS_ON_BAN, ci->ttb[TTB_ITALICS]);
+ else
+ notice_lang(Config.s_BotServ, u, BOT_KICK_ITALICS_ON);
+ }
+ else
+ {
+ ci->botflags.UnsetFlag(BS_KICK_ITALICS);
+ notice_lang(Config.s_BotServ, u, BOT_KICK_ITALICS_OFF);
+ }
+ }
else
notice_help(Config.s_BotServ, u, BOT_KICK_UNKNOWN, option.c_str());
}
@@ -357,6 +387,8 @@ class CommandBSKick : public Command
notice_help(Config.s_BotServ, u, BOT_HELP_KICK_REVERSES);
else if (subcommand.equals_ci("UNDERLINES"))
notice_help(Config.s_BotServ, u, BOT_HELP_KICK_UNDERLINES);
+ else if (subcommand.equals_ci("ITALICS"))
+ notice_help(Config.s_BotServ, u, BOT_HELP_KICK_ITALICS);
else
return false;
diff --git a/modules/core/db_plain.cpp b/modules/core/db_plain.cpp
index 84e569f9a..87653ba59 100644
--- a/modules/core/db_plain.cpp
+++ b/modules/core/db_plain.cpp
@@ -329,6 +329,7 @@ BotFlagInfo BotFlags[] = {
{"KICK_CAPS", BS_KICK_CAPS},
{"KICK_FLOOD", BS_KICK_FLOOD},
{"KICK_REPEAT", BS_KICK_REPEAT},
+ {"KICK_ITALICS", BS_KICK_ITALICS},
{"", static_cast<BotServFlag>(-1)}
};
@@ -830,6 +831,8 @@ class DBPlain : public Module
ci->ttb[6] = params[j + 1].is_number_only() ? convertTo<int16>(params[j + 1]) : 0;
else if (params[j].equals_ci("REPEAT"))
ci->ttb[7] = params[j + 1].is_number_only() ? convertTo<int16>(params[j + 1]) : 0;
+ else if (params[j].equals_ci("ITALICS"))
+ ci->ttb[8] = params[j + 1].is_number_only() ? convertTo<int16>(params[j + 1]) : 0;
}
}
else if (params[0].equals_ci("CAPSMIN"))
@@ -1078,7 +1081,7 @@ class DBPlain : public Module
db << " " << BotFlags[j].Name;
db << endl;
}
- db << "MD BI TTB BOLDS " << ci->ttb[0] << " COLORS " << ci->ttb[1] << " REVERSES " << ci->ttb[2] << " UNDERLINES " << ci->ttb[3] << " BADWORDS " << ci->ttb[4] << " CAPS " << ci->ttb[5] << " FLOOD " << ci->ttb[6] << " REPEAT " << ci->ttb[7] << endl;
+ db << "MD BI TTB BOLDS " << ci->ttb[0] << " COLORS " << ci->ttb[1] << " REVERSES " << ci->ttb[2] << " UNDERLINES " << ci->ttb[3] << " BADWORDS " << ci->ttb[4] << " CAPS " << ci->ttb[5] << " FLOOD " << ci->ttb[6] << " REPEAT " << ci->ttb[7] << " ITALICS " << ci->ttb[8] << endl;
if (ci->capsmin)
db << "MD BI CAPSMIN " << ci->capsmin << endl;
if (ci->capspercent)