diff options
Diffstat (limited to 'modules/core')
-rw-r--r-- | modules/core/bs_info.cpp | 6 | ||||
-rw-r--r-- | modules/core/bs_set.cpp | 35 | ||||
-rw-r--r-- | modules/core/db_plain.cpp | 3 | ||||
-rw-r--r-- | modules/core/hs_list.cpp | 2 |
4 files changed, 44 insertions, 2 deletions
diff --git a/modules/core/bs_info.cpp b/modules/core/bs_info.cpp index 0a86748c3..7c3ea2ef9 100644 --- a/modules/core/bs_info.cpp +++ b/modules/core/bs_info.cpp @@ -162,6 +162,12 @@ class CommandBSInfo : public Command } else source.Reply(BOT_INFO_CHAN_KICK_ITALICS, GetString(u, BOT_INFO_INACTIVE).c_str()); + if (ci->botflags.HasFlag(BS_MSG_PRIVMSG)) + source.Reply(BOT_INFO_CHAN_MSG, "PRIVMSG"); + else if (ci->botflags.HasFlag(BS_MSG_NOTICE)) + source.Reply(BOT_INFO_CHAN_MSG, "NOTICE"); + else if (ci->botflags.HasFlag(BS_MSG_NOTICEOPS)) + source.Reply(BOT_INFO_CHAN_MSG, "NOTICEOPS"); end = buf; *end = 0; diff --git a/modules/core/bs_set.cpp b/modules/core/bs_set.cpp index 99cf6c415..b9e06a4db 100644 --- a/modules/core/bs_set.cpp +++ b/modules/core/bs_set.cpp @@ -157,6 +157,39 @@ class CommandBSSet : public Command else SyntaxError(BotServ, u, "SET SYMBIOSIS", BOT_SET_SYMBIOSIS_SYNTAX); } + else if (option.equals_ci("MSG")) + { + if (value.equals_ci("OFF")) + { + ci->botflags.UnsetFlag(BS_MSG_PRIVMSG); + ci->botflags.UnsetFlag(BS_MSG_NOTICE); + ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS); + source.Reply(BOT_SET_MSG_OFF, ci->name.c_str()); + } + else if (value.equals_ci("PRIVMSG")) + { + ci->botflags.SetFlag(BS_MSG_PRIVMSG); + ci->botflags.UnsetFlag(BS_MSG_NOTICE); + ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS); + source.Reply(BOT_SET_MSG_PRIVMSG, ci->name.c_str()); + } + else if (value.equals_ci("NOTICE")) + { + ci->botflags.UnsetFlag(BS_MSG_PRIVMSG); + ci->botflags.SetFlag(BS_MSG_NOTICE); + ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS); + source.Reply(BOT_SET_MSG_NOTICE, ci->name.c_str()); + } + else if (value.equals_ci("NOTICEOPS")) + { + ci->botflags.UnsetFlag(BS_MSG_PRIVMSG); + ci->botflags.UnsetFlag(BS_MSG_NOTICE); + ci->botflags.SetFlag(BS_MSG_NOTICEOPS); + source.Reply(BOT_SET_MSG_NOTICEOPS, ci->name.c_str()); + } + else + SyntaxError(BotServ, u, "SET MSG", BOT_SET_MSG_SYNTAX); + } else source.Reply(BOT_SET_UNKNOWN, option.c_str()); } @@ -186,6 +219,8 @@ class CommandBSSet : public Command u->SendMessage(BotServ, BOT_SERVADMIN_HELP_SET_NOBOT); else if (subcommand.equals_ci("PRIVATE")) u->SendMessage(BotServ, BOT_SERVADMIN_HELP_SET_PRIVATE); + else if (subcommand.equals_ci("MSG")) + u->SendMessage(BotServ, BOT_HELP_SET_MSG); else return false; diff --git a/modules/core/db_plain.cpp b/modules/core/db_plain.cpp index 953f35b4a..2c655b7d9 100644 --- a/modules/core/db_plain.cpp +++ b/modules/core/db_plain.cpp @@ -305,6 +305,9 @@ BotFlagInfo BotFlags[] = { {"KICK_FLOOD", BS_KICK_FLOOD}, {"KICK_REPEAT", BS_KICK_REPEAT}, {"KICK_ITALICS", BS_KICK_ITALICS}, + {"MSG_PRIVMSG", BS_MSG_PRIVMSG}, + {"MSG_NOTICE", BS_MSG_NOTICE}, + {"MSG_NOTICEOPS", BS_MSG_NOTICEOPS}, {"", static_cast<BotServFlag>(-1)} }; diff --git a/modules/core/hs_list.cpp b/modules/core/hs_list.cpp index 543aa273a..23ce31f9a 100644 --- a/modules/core/hs_list.cpp +++ b/modules/core/hs_list.cpp @@ -22,8 +22,6 @@ class CommandHSList : public Command CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) { - User *u = source.u; - const Anope::string &key = !params.empty() ? params[0] : ""; int from = 0, to = 0, counter = 1; unsigned display_counter = 0; |