diff options
Diffstat (limited to 'modules')
92 files changed, 1189 insertions, 1260 deletions
diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp index e6bb5e539..e778faffe 100644 --- a/modules/commands/bs_assign.cpp +++ b/modules/commands/bs_assign.cpp @@ -48,13 +48,13 @@ class CommandBSAssign : public Command } AccessGroup access = source.AccessFor(ci); - if (ci->botflags.HasFlag(BS_NOBOT) || (!access.HasPriv("ASSIGN") && !source.HasPriv("botserv/administration"))) + if (ci->HasExt("BS_NOBOT") || (!access.HasPriv("ASSIGN") && !source.HasPriv("botserv/administration"))) { source.Reply(ACCESS_DENIED); return; } - if (bi->HasFlag(BI_PRIVATE) && !source.HasCommand("botserv/assign/private")) + if (bi->oper_only && !source.HasCommand("botserv/assign/private")) { source.Reply(ACCESS_DENIED); return; @@ -121,7 +121,7 @@ class CommandBSUnassign : public Command return; } - if (ci->HasFlag(CI_PERSIST) && !ModeManager::FindChannelModeByName(CMODE_PERM)) + if (ci->HasExt("PERSIST") && !ModeManager::FindChannelModeByName("PERM")) { source.Reply(_("You can not unassign bots while persist is set on the channel.")); return; diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp index 737e81a46..793d739c8 100644 --- a/modules/commands/bs_bot.cpp +++ b/modules/commands/bs_bot.cpp @@ -107,7 +107,7 @@ class CommandBSBot : public Command return; } - if (bi->HasFlag(BI_CONF)) + if (bi->conf) { source.Reply(_("Bot %s is not changable."), bi->nick.c_str()); return; @@ -232,7 +232,7 @@ class CommandBSBot : public Command return; } - if (bi->HasFlag(BI_CONF)) + if (bi->conf) { source.Reply(_("Bot %s is not deletable."), bi->nick.c_str()); return; diff --git a/modules/commands/bs_botlist.cpp b/modules/commands/bs_botlist.cpp index 148a4fb20..c4a559443 100644 --- a/modules/commands/bs_botlist.cpp +++ b/modules/commands/bs_botlist.cpp @@ -33,11 +33,11 @@ class CommandBSBotList : public Command { BotInfo *bi = it->second; - if (source.HasCommand("botserv/botlist") || !bi->HasFlag(BI_PRIVATE)) + if (source.HasCommand("botserv/botlist") || !bi->oper_only) { ++count; ListFormatter::ListEntry entry; - entry["Nick"] = (bi->HasFlag(BI_PRIVATE) ? "* " : "") + bi->nick; + entry["Nick"] = (bi->oper_only ? "* " : "") + bi->nick; entry["Mask"] = bi->GetIdent() + "@" + bi->host; list.AddEntry(entry); } diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp index 60f2901a3..7edcedfda 100644 --- a/modules/commands/bs_info.cpp +++ b/modules/commands/bs_info.cpp @@ -38,9 +38,9 @@ class CommandBSInfo : public Command buffers.push_back(buf); } - void CheckOptStr(Anope::string &buf, BotServFlag flag, const char *option, Flags<BotServFlag> &flags, const NickCore *nc) + void CheckOptStr(Anope::string &buf, const Anope::string &flag, const char *option, Extensible *flags, const NickCore *nc) { - if (flags.HasFlag(flag)) + if (flags->HasExt(flag)) { if (!buf.empty()) buf += ", "; @@ -69,7 +69,7 @@ class CommandBSInfo : public Command info[_("Mask")] = bi->GetIdent() + "@" + bi->host; info[_("Real name")] = bi->realname; info[_("Created")] = Anope::strftime(bi->created); - info[_("Options")] = bi->HasFlag(BI_PRIVATE) ? _("Private") : _("None"); + info[_("Options")] = bi->oper_only ? _("Private") : _("None"); info[_("Used on")] = stringify(bi->GetChannelCount()) + " channel(s)"; std::vector<Anope::string> replies; @@ -101,7 +101,7 @@ class CommandBSInfo : public Command Anope::string enabled = Language::Translate(source.nc, _("Enabled")); Anope::string disabled = Language::Translate(source.nc, _("Disabled")); - if (ci->botflags.HasFlag(BS_KICK_BADWORDS)) + if (ci->HasExt("BS_KICK_BADWORDS")) { if (ci->ttb[TTB_BADWORDS]) info[_("Bad words kicker")] = Anope::printf("%s (%d kick(s) to ban)", enabled.c_str(), ci->ttb[TTB_BADWORDS]); @@ -111,7 +111,7 @@ class CommandBSInfo : public Command else info[_("Bad words kicker")] = disabled; - if (ci->botflags.HasFlag(BS_KICK_BOLDS)) + if (ci->HasExt("BS_KICK_BOLDS")) { if (ci->ttb[TTB_BOLDS]) info[_("Bolds kicker")] = Anope::printf("%s (%d kick(s) to ban)", enabled.c_str(), ci->ttb[TTB_BOLDS]); @@ -121,7 +121,7 @@ class CommandBSInfo : public Command else info[_("Bolds kicker")] = disabled; - if (ci->botflags.HasFlag(BS_KICK_CAPS)) + if (ci->HasExt("BS_KICK_CAPS")) { if (ci->ttb[TTB_CAPS]) info[_("Caps kicker")] = Anope::printf(_("%s (%d kick(s) to ban; minimum %d/%d%%"), enabled.c_str(), ci->ttb[TTB_CAPS], ci->capsmin, ci->capspercent); @@ -131,7 +131,7 @@ class CommandBSInfo : public Command else info[_("Caps kicker")] = disabled; - if (ci->botflags.HasFlag(BS_KICK_COLORS)) + if (ci->HasExt("BS_KICK_COLORS")) { if (ci->ttb[TTB_COLORS]) info[_("Colors kicker")] = Anope::printf(_("%s (%d kick(s) to ban)"), enabled.c_str(), ci->ttb[TTB_COLORS]); @@ -141,7 +141,7 @@ class CommandBSInfo : public Command else info[_("Colors kicker")] = disabled; - if (ci->botflags.HasFlag(BS_KICK_FLOOD)) + if (ci->HasExt("BS_KICK_FLOOD")) { if (ci->ttb[TTB_FLOOD]) info[_("Flood kicker")] = Anope::printf(_("%s (%d kick(s) to ban; %d lines in %ds"), enabled.c_str(), ci->ttb[TTB_FLOOD], ci->floodlines, ci->floodsecs); @@ -151,7 +151,7 @@ class CommandBSInfo : public Command else info[_("Flood kicker")] = disabled; - if (ci->botflags.HasFlag(BS_KICK_REPEAT)) + if (ci->HasExt("BS_KICK_REPEAT")) { if (ci->ttb[TTB_REPEAT]) info[_("Repeat kicker")] = Anope::printf(_("%s (%d kick(s) to ban; %d times)"), enabled.c_str(), ci->ttb[TTB_REPEAT], ci->repeattimes); @@ -161,7 +161,7 @@ class CommandBSInfo : public Command else info[_("Repeat kicker")] = disabled; - if (ci->botflags.HasFlag(BS_KICK_REVERSES)) + if (ci->HasExt("BS_KICK_REVERSES")) { if (ci->ttb[TTB_REVERSES]) info[_("Reverses kicker")] = Anope::printf(_("%s (%d kick(s) to ban)"), enabled.c_str(), ci->ttb[TTB_REVERSES]); @@ -171,7 +171,7 @@ class CommandBSInfo : public Command else info[_("Reverses kicker")] = disabled; - if (ci->botflags.HasFlag(BS_KICK_UNDERLINES)) + if (ci->HasExt("BS_KICK_UNDERLINES")) { if (ci->ttb[TTB_UNDERLINES]) info[_("Underlines kicker")] = Anope::printf(_("%s (%d kick(s) to ban)"), enabled.c_str(), ci->ttb[TTB_UNDERLINES]); @@ -181,7 +181,7 @@ class CommandBSInfo : public Command else info[_("Underlines kicker")] = disabled; - if (ci->botflags.HasFlag(BS_KICK_ITALICS)) + if (ci->HasExt("BS_KICK_ITALICS")) { if (ci->ttb[TTB_ITALICS]) info[_("Italics kicker")] = Anope::printf(_("%s (%d kick(s) to ban)"), enabled.c_str(), ci->ttb[TTB_ITALICS]); @@ -191,7 +191,7 @@ class CommandBSInfo : public Command else info[_("Italics kicker")] = disabled; - if (ci->botflags.HasFlag(BS_KICK_AMSGS)) + if (ci->HasExt("BS_KICK_AMSGS")) { if (ci->ttb[TTB_AMSGS]) info[_("AMSG kicker")] = Anope::printf(_("%s (%d kick(s) to ban)"), enabled.c_str(), ci->ttb[TTB_AMSGS]); @@ -202,11 +202,11 @@ class CommandBSInfo : public Command info[_("AMSG kicker")] = disabled; Anope::string flags; - CheckOptStr(flags, BS_DONTKICKOPS, _("Ops protection"), ci->botflags, source.nc); - CheckOptStr(flags, BS_DONTKICKVOICES, _("Voices protection"), ci->botflags, source.nc); - CheckOptStr(flags, BS_FANTASY, _("Fantasy"), ci->botflags, source.nc); - CheckOptStr(flags, BS_GREET, _("Greet"), ci->botflags, source.nc); - CheckOptStr(flags, BS_NOBOT, _("No bot"), ci->botflags, source.nc); + CheckOptStr(flags, "BS_DONTKICKOPS", _("Ops protection"), ci, source.nc); + CheckOptStr(flags, "BS_DONTKICKVOICES", _("Voices protection"), ci, source.nc); + CheckOptStr(flags, "BS_FANTASY", _("Fantasy"), ci, source.nc); + CheckOptStr(flags, "BS_GREET", _("Greet"), ci, source.nc); + CheckOptStr(flags, "BS_NOBOT", _("No bot"), ci, source.nc); info[_("Options")] = flags.empty() ? _("None") : flags; diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index fe48d7d8e..499f21464 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -72,7 +72,7 @@ class CommandBSKick : public Command else ci->ttb[TTB_BADWORDS] = 0; - ci->botflags.SetFlag(BS_KICK_BADWORDS); + ci->ExtendMetadata("BS_KICK_BADWORDS"); if (ci->ttb[TTB_BADWORDS]) source.Reply(_("Bot will now kick \002bad words\002, and will place a ban after \n" "%d kicks for the same user. Use the BADWORDS command\n" @@ -83,7 +83,7 @@ class CommandBSKick : public Command } else { - ci->botflags.UnsetFlag(BS_KICK_BADWORDS); + ci->Shrink("BS_KICK_BADWORDS"); source.Reply(_("Bot won't kick \002bad words\002 anymore.")); } } @@ -108,7 +108,7 @@ class CommandBSKick : public Command } else ci->ttb[TTB_BOLDS] = 0; - ci->botflags.SetFlag(BS_KICK_BOLDS); + ci->ExtendMetadata("BS_KICK_BOLDS"); if (ci->ttb[TTB_BOLDS]) source.Reply(_("Bot will now kick \002bolds\002, and will place a ban after\n%d kicks to the same user."), ci->ttb[TTB_BOLDS]); else @@ -116,7 +116,7 @@ class CommandBSKick : public Command } else { - ci->botflags.UnsetFlag(BS_KICK_BOLDS); + ci->Shrink("BS_KICK_BOLDS"); source.Reply(_("Bot won't kick \002bolds\002 anymore.")); } } @@ -163,7 +163,7 @@ class CommandBSKick : public Command if (ci->capspercent < 1 || ci->capspercent > 100) ci->capspercent = 25; - ci->botflags.SetFlag(BS_KICK_CAPS); + ci->ExtendMetadata("BS_KICK_CAPS"); if (ci->ttb[TTB_CAPS]) source.Reply(_("Bot will now kick \002caps\002 (they must constitute at least\n" "%d characters and %d%% of the entire message), and will \n" @@ -174,7 +174,7 @@ class CommandBSKick : public Command } else { - ci->botflags.UnsetFlag(BS_KICK_CAPS); + ci->Shrink("BS_KICK_CAPS"); source.Reply(_("Bot won't kick \002caps\002 anymore.")); } } @@ -200,7 +200,7 @@ class CommandBSKick : public Command else ci->ttb[TTB_COLORS] = 0; - ci->botflags.SetFlag(BS_KICK_COLORS); + ci->ExtendMetadata("BS_KICK_COLORS"); if (ci->ttb[TTB_COLORS]) source.Reply(_("Bot will now kick \002colors\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_COLORS]); else @@ -208,7 +208,7 @@ class CommandBSKick : public Command } else { - ci->botflags.UnsetFlag(BS_KICK_COLORS); + ci->Shrink("BS_KICK_COLORS"); source.Reply(_("Bot won't kick \002colors\002 anymore.")); } } @@ -257,7 +257,7 @@ class CommandBSKick : public Command if (ci->floodsecs > Config->BSKeepData) ci->floodsecs = Config->BSKeepData; - ci->botflags.SetFlag(BS_KICK_FLOOD); + ci->ExtendMetadata("BS_KICK_FLOOD"); if (ci->ttb[TTB_FLOOD]) source.Reply(_("Bot will now kick \002flood\002 (%d lines in %d seconds and\nwill place a ban after %d kicks for the same user."), ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]); else @@ -265,7 +265,7 @@ class CommandBSKick : public Command } else { - ci->botflags.UnsetFlag(BS_KICK_FLOOD); + ci->Shrink("BS_KICK_FLOOD"); source.Reply(_("Bot won't kick \002flood\002 anymore.")); } } @@ -302,7 +302,7 @@ class CommandBSKick : public Command if (ci->repeattimes < 2) ci->repeattimes = 3; - ci->botflags.SetFlag(BS_KICK_REPEAT); + ci->ExtendMetadata("BS_KICK_REPEAT"); if (ci->ttb[TTB_REPEAT]) source.Reply(_("Bot will now kick \002repeats\002 (users that say the\n" "same thing %d times), and will place a ban after %d \n" @@ -313,7 +313,7 @@ class CommandBSKick : public Command } else { - ci->botflags.UnsetFlag(BS_KICK_REPEAT); + ci->Shrink("BS_KICK_REPEAT"); source.Reply(_("Bot won't kick \002repeats\002 anymore.")); } } @@ -338,7 +338,7 @@ class CommandBSKick : public Command } else ci->ttb[TTB_REVERSES] = 0; - ci->botflags.SetFlag(BS_KICK_REVERSES); + ci->ExtendMetadata("BS_KICK_REVERSES"); if (ci->ttb[TTB_REVERSES]) source.Reply(_("Bot will now kick \002reverses\002, and will place a ban after %d\n |
