mirror of
https://github.com/anope/anope.git
synced 2026-07-04 13:33:13 +02:00
Return references instead of pointers from the config system.
We used to return NULL from these methods but now we return an empty block so this can never actually be null now.
This commit is contained in:
@@ -93,7 +93,7 @@ class CommandCSFlags final
|
||||
|
||||
if (IRCD->IsChannelValid(mask))
|
||||
{
|
||||
if (Config->GetModule("chanserv")->Get<bool>("disallow_channel_access"))
|
||||
if (Config->GetModule("chanserv").Get<bool>("disallow_channel_access"))
|
||||
{
|
||||
source.Reply(_("Channels may not be on access lists."));
|
||||
return;
|
||||
@@ -116,7 +116,7 @@ class CommandCSFlags final
|
||||
else
|
||||
{
|
||||
na = NickAlias::Find(mask);
|
||||
if (!na && Config->GetModule("chanserv")->Get<bool>("disallow_hostmask_access"))
|
||||
if (!na && Config->GetModule("chanserv").Get<bool>("disallow_hostmask_access"))
|
||||
{
|
||||
source.Reply(_("Masks and unregistered users may not be on access lists."));
|
||||
return;
|
||||
@@ -179,7 +179,7 @@ class CommandCSFlags final
|
||||
}
|
||||
}
|
||||
|
||||
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1000");
|
||||
unsigned access_max = Config->GetModule("chanserv").Get<unsigned>("accessmax", "1000");
|
||||
if (access_max && ci->GetDeepAccessCount() >= access_max)
|
||||
{
|
||||
source.Reply(_("Sorry, you can only have %d access entries on a channel, including access entries from other channels."), access_max);
|
||||
@@ -494,21 +494,21 @@ public:
|
||||
|
||||
}
|
||||
|
||||
void OnReload(Configuration::Conf *conf) override
|
||||
void OnReload(Configuration::Conf &conf) override
|
||||
{
|
||||
defaultFlags.clear();
|
||||
|
||||
for (int i = 0; i < conf->CountBlock("privilege"); ++i)
|
||||
for (int i = 0; i < conf.CountBlock("privilege"); ++i)
|
||||
{
|
||||
Configuration::Block *priv = conf->GetBlock("privilege", i);
|
||||
Configuration::Block &priv = conf.GetBlock("privilege", i);
|
||||
|
||||
const Anope::string &pname = priv->Get<const Anope::string>("name");
|
||||
const Anope::string &pname = priv.Get<const Anope::string>("name");
|
||||
|
||||
Privilege *p = PrivilegeManager::FindPrivilege(pname);
|
||||
if (p == NULL)
|
||||
continue;
|
||||
|
||||
const Anope::string &value = priv->Get<const Anope::string>("flag");
|
||||
const Anope::string &value = priv.Get<const Anope::string>("flag");
|
||||
if (value.empty())
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user