summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-01-21 22:31:16 -0500
committerAdam <Adam@anope.org>2013-01-21 22:31:16 -0500
commitddaa001dafb5122e6e363e4acbbe6ce045b7b104 (patch)
tree0364a76606ac6e2881ebd663601ce260f7c1101e /modules
parent51c049e1a738e9124bab3961f35b830906517421 (diff)
Merge usefulness of Flags and Extensible classes into Extensible, made most flags we have juse strings instead of defines/enums
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/bs_assign.cpp6
-rw-r--r--modules/commands/bs_bot.cpp4
-rw-r--r--modules/commands/bs_botlist.cpp4
-rw-r--r--modules/commands/bs_info.cpp36
-rw-r--r--modules/commands/bs_kick.cpp74
-rw-r--r--modules/commands/bs_set.cpp24
-rw-r--r--modules/commands/cs_akick.cpp28
-rw-r--r--modules/commands/cs_ban.cpp22
-rw-r--r--modules/commands/cs_clone.cpp14
-rw-r--r--modules/commands/cs_drop.cpp6
-rw-r--r--modules/commands/cs_enforce.cpp22
-rw-r--r--modules/commands/cs_getkey.cpp2
-rw-r--r--modules/commands/cs_info.cpp44
-rw-r--r--modules/commands/cs_kick.cpp8
-rw-r--r--modules/commands/cs_list.cpp10
-rw-r--r--modules/commands/cs_mode.cpp2
-rw-r--r--modules/commands/cs_register.cpp20
-rw-r--r--modules/commands/cs_seen.cpp6
-rw-r--r--modules/commands/cs_set.cpp78
-rw-r--r--modules/commands/cs_status.cpp4
-rw-r--r--modules/commands/cs_suspend.cpp112
-rw-r--r--modules/commands/cs_topic.cpp10
-rw-r--r--modules/commands/cs_updown.cpp4
-rw-r--r--modules/commands/help.cpp6
-rw-r--r--modules/commands/hs_off.cpp2
-rw-r--r--modules/commands/hs_on.cpp2
-rw-r--r--modules/commands/ms_cancel.cpp2
-rw-r--r--modules/commands/ms_check.cpp2
-rw-r--r--modules/commands/ms_info.cpp26
-rw-r--r--modules/commands/ms_list.cpp8
-rw-r--r--modules/commands/ms_read.cpp8
-rw-r--r--modules/commands/ms_rsend.cpp2
-rw-r--r--modules/commands/ms_set.cpp34
-rw-r--r--modules/commands/ns_access.cpp2
-rw-r--r--modules/commands/ns_ajoin.cpp20
-rw-r--r--modules/commands/ns_alist.cpp4
-rw-r--r--modules/commands/ns_cert.cpp6
-rw-r--r--modules/commands/ns_group.cpp18
-rw-r--r--modules/commands/ns_identify.cpp6
-rw-r--r--modules/commands/ns_info.cpp38
-rw-r--r--modules/commands/ns_list.cpp16
-rw-r--r--modules/commands/ns_logout.cpp2
-rw-r--r--modules/commands/ns_recover.cpp17
-rw-r--r--modules/commands/ns_register.cpp28
-rw-r--r--modules/commands/ns_resetpass.cpp4
-rw-r--r--modules/commands/ns_set.cpp65
-rw-r--r--modules/commands/ns_status.cpp2
-rw-r--r--modules/commands/ns_suspend.cpp108
-rw-r--r--modules/commands/ns_update.cpp2
-rw-r--r--modules/commands/os_chankill.cpp2
-rw-r--r--modules/commands/os_defcon.cpp53
-rw-r--r--modules/commands/os_dns.cpp4
-rw-r--r--modules/commands/os_forbid.cpp14
-rw-r--r--modules/commands/os_ignore.cpp4
-rw-r--r--modules/commands/os_jupe.cpp2
-rw-r--r--modules/commands/os_list.cpp26
-rw-r--r--modules/commands/os_login.cpp6
-rw-r--r--modules/commands/os_news.cpp4
-rw-r--r--modules/commands/os_noop.cpp8
-rw-r--r--modules/commands/os_oline.cpp2
-rw-r--r--modules/commands/os_sxline.cpp6
-rw-r--r--modules/database/db_flatfile.cpp16
-rw-r--r--modules/database/db_old.cpp90
-rw-r--r--modules/database/db_plain.cpp104
-rw-r--r--modules/extra/cs_statusupdate.cpp14
-rw-r--r--modules/extra/m_chanstats.cpp19
-rw-r--r--modules/extra/m_dnsbl.cpp2
-rw-r--r--modules/extra/m_helpchan.cpp6
-rw-r--r--modules/extra/m_proxyscan.cpp2
-rw-r--r--modules/extra/m_sql_oper.cpp4
-rw-r--r--modules/extra/m_ssl.cpp35
-rw-r--r--modules/extra/m_xmlrpc_main.cpp12
-rw-r--r--modules/extra/webcpanel/pages/chanserv/drop.cpp6
-rw-r--r--modules/extra/webcpanel/pages/chanserv/set.cpp70
-rw-r--r--modules/extra/webcpanel/pages/memoserv/memos.cpp10
-rw-r--r--modules/extra/webcpanel/pages/nickserv/alist.cpp4
-rw-r--r--modules/extra/webcpanel/pages/nickserv/info.cpp54
-rw-r--r--modules/protocol/bahamut.cpp54
-rw-r--r--modules/protocol/hybrid.cpp58
-rw-r--r--modules/protocol/inspircd11.cpp94
-rw-r--r--modules/protocol/inspircd12.cpp148
-rw-r--r--modules/protocol/inspircd20.cpp134
-rw-r--r--modules/protocol/ngircd.cpp76
-rw-r--r--modules/protocol/plexus.cpp52
-rw-r--r--modules/protocol/ratbox.cpp18
-rw-r--r--modules/protocol/unreal.cpp154
-rw-r--r--modules/pseudoclients/botserv.cpp26
-rw-r--r--modules/pseudoclients/chanserv.cpp8
-rw-r--r--modules/pseudoclients/global.cpp2
-rw-r--r--modules/pseudoclients/memoserv.cpp10
-rw-r--r--modules/pseudoclients/nickserv.cpp52
-rw-r--r--modules/pseudoclients/operserv.cpp14
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)