summaryrefslogtreecommitdiff
path: root/modules/commands/cs_flags.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/cs_flags.cpp')
-rw-r--r--modules/commands/cs_flags.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp
index 4681c3d61..18b72ef29 100644
--- a/modules/commands/cs_flags.cpp
+++ b/modules/commands/cs_flags.cpp
@@ -13,6 +13,7 @@
#include "module.h"
+static ServiceReference<ChanServService> chanserv("ChanServService", "ChanServ");
static std::map<Anope::string, char> defaultFlags;
class FlagsChanAccess : public ChanAccess
@@ -113,9 +114,10 @@ class CommandCSFlags : public Command
}
}
- if (ci->GetAccessCount() >= Config->CSAccessMax)
+ unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1024");
+ if (access_max && ci->GetAccessCount() >= access_max)
{
- source.Reply(_("Sorry, you can only have %d access entries on a channel."), Config->CSAccessMax);
+ source.Reply(_("Sorry, you can only have %d access entries on a channel."), access_max);
return;
}
@@ -387,32 +389,30 @@ class CSFlags : public Module
CommandCSFlags commandcsflags;
public:
- CSFlags(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
+ CSFlags(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
accessprovider(this), commandcsflags(this)
{
- this->SetAuthor("Anope");
this->SetPermanent(true);
Implementation i[] = { I_OnReload };
ModuleManager::Attach(i, this, 1);
-
- this->OnReload();
}
- void OnReload() anope_override
+ void OnReload(Configuration::Conf *conf) anope_override
{
- ConfigReader config;
defaultFlags.clear();
- for (int i = 0; i < config.Enumerate("privilege"); ++i)
+ for (int i = 0; i < conf->CountBlock("privilege"); ++i)
{
- const Anope::string &pname = config.ReadValue("privilege", "name", "", i);
+ Configuration::Block *priv = conf->GetBlock("privilege", i);
+
+ const Anope::string &pname = priv->Get<const Anope::string>("name");
Privilege *p = PrivilegeManager::FindPrivilege(pname);
if (p == NULL)
continue;
- const Anope::string &value = config.ReadValue("privilege", "flag", "", i);
+ const Anope::string &value = priv->Get<const Anope::string>("flag");
if (value.empty())
continue;