summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-03-02 14:51:02 +0000
committerSadie Powell <sadie@witchery.services>2025-03-02 15:27:47 +0000
commitf9911dde529adf3dc03f4f14bbd70756ac2f665c (patch)
tree7c720e4f82fdb30b7d8a22fc0809f50bc862fae3 /modules
parenta5e5eb5eb084e8343260ce7bc26ea86798f64fe1 (diff)
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/botserv/botserv.cpp30
-rw-r--r--modules/botserv/bs_autoassign.cpp2
-rw-r--r--modules/botserv/bs_badwords.cpp4
-rw-r--r--modules/botserv/bs_kick.cpp10
-rw-r--r--modules/botserv/bs_set.cpp4
-rw-r--r--modules/chanserv/chanserv.cpp32
-rw-r--r--modules/chanserv/cs_access.cpp20
-rw-r--r--modules/chanserv/cs_akick.cpp8
-rw-r--r--modules/chanserv/cs_ban.cpp12
-rw-r--r--modules/chanserv/cs_clone.cpp2
-rw-r--r--modules/chanserv/cs_entrymsg.cpp2
-rw-r--r--modules/chanserv/cs_fantasy_stats.cpp6
-rw-r--r--modules/chanserv/cs_fantasy_top.cpp6
-rw-r--r--modules/chanserv/cs_flags.cpp16
-rw-r--r--modules/chanserv/cs_kick.cpp4
-rw-r--r--modules/chanserv/cs_list.cpp6
-rw-r--r--modules/chanserv/cs_log.cpp14
-rw-r--r--modules/chanserv/cs_mode.cpp18
-rw-r--r--modules/chanserv/cs_register.cpp2
-rw-r--r--modules/chanserv/cs_seen.cpp6
-rw-r--r--modules/chanserv/cs_set.cpp18
-rw-r--r--modules/chanserv/cs_set_misc.cpp14
-rw-r--r--modules/chanserv/cs_suspend.cpp6
-rw-r--r--modules/chanserv/cs_xop.cpp24
-rw-r--r--modules/chanstats.cpp20
-rw-r--r--modules/database/db_atheme.cpp18
-rw-r--r--modules/database/db_flatfile.cpp18
-rw-r--r--modules/database/db_old.cpp2
-rw-r--r--modules/database/db_redis.cpp6
-rw-r--r--modules/database/db_sql.cpp10
-rw-r--r--modules/database/db_sql_live.cpp10
-rw-r--r--modules/dns.cpp26
-rw-r--r--modules/dnsbl.cpp38
-rw-r--r--modules/encryption/enc_bcrypt.cpp6
-rw-r--r--modules/encryption/enc_sha2.cpp4
-rw-r--r--modules/extra/enc_argon2.cpp16
-rw-r--r--modules/extra/ldap.cpp22
-rw-r--r--modules/extra/mysql.cpp28
-rw-r--r--modules/extra/sqlite.cpp16
-rw-r--r--modules/extra/ssl_gnutls.cpp14
-rw-r--r--modules/extra/ssl_openssl.cpp18
-rw-r--r--modules/extra/xmlrpc.cpp4
-rw-r--r--modules/fantasy.cpp4
-rw-r--r--modules/global/gl_queue.cpp2
-rw-r--r--modules/global/global.cpp12
-rw-r--r--modules/help.cpp4
-rw-r--r--modules/helpchan.cpp2
-rw-r--r--modules/hostserv/hostserv.cpp10
-rw-r--r--modules/hostserv/hs_group.cpp8
-rw-r--r--modules/hostserv/hs_list.cpp2
-rw-r--r--modules/hostserv/hs_request.cpp16
-rw-r--r--modules/httpd.cpp22
-rw-r--r--modules/irc2sql/irc2sql.cpp16
-rw-r--r--modules/irc2sql/irc2sql.h2
-rw-r--r--modules/ldap_authentication.cpp22
-rw-r--r--modules/ldap_oper.cpp14
-rw-r--r--modules/memoserv/memoserv.cpp18
-rw-r--r--modules/memoserv/ms_ignore.cpp2
-rw-r--r--modules/memoserv/ms_rsend.cpp4
-rw-r--r--modules/memoserv/ms_send.cpp2
-rw-r--r--modules/memoserv/ms_set.cpp4
-rw-r--r--modules/nickserv/nickserv.cpp56
-rw-r--r--modules/nickserv/ns_ajoin.cpp4
-rw-r--r--modules/nickserv/ns_cert.cpp10
-rw-r--r--modules/nickserv/ns_drop.cpp4
-rw-r--r--modules/nickserv/ns_group.cpp14
-rw-r--r--modules/nickserv/ns_identify.cpp2
-rw-r--r--modules/nickserv/ns_list.cpp4
-rw-r--r--modules/nickserv/ns_maxemail.cpp6
-rw-r--r--modules/nickserv/ns_recover.cpp8
-rw-r--r--modules/nickserv/ns_register.cpp48
-rw-r--r--modules/nickserv/ns_resetpass.cpp10
-rw-r--r--modules/nickserv/ns_set.cpp32
-rw-r--r--modules/nickserv/ns_set_keepmodes.cpp2
-rw-r--r--modules/nickserv/ns_set_kill.cpp4
-rw-r--r--modules/nickserv/ns_set_misc.cpp12
-rw-r--r--modules/nickserv/ns_suspend.cpp8
-rw-r--r--modules/operserv/operserv.cpp6
-rw-r--r--modules/operserv/os_akill.cpp14
-rw-r--r--modules/operserv/os_chankill.cpp4
-rw-r--r--modules/operserv/os_config.cpp14
-rw-r--r--modules/operserv/os_defcon.cpp47
-rw-r--r--modules/operserv/os_dns.cpp18
-rw-r--r--modules/operserv/os_forbid.cpp8
-rw-r--r--modules/operserv/os_ignore.cpp2
-rw-r--r--modules/operserv/os_info.cpp2
-rw-r--r--modules/operserv/os_kill.cpp2
-rw-r--r--modules/operserv/os_list.cpp4
-rw-r--r--modules/operserv/os_logsearch.cpp2
-rw-r--r--modules/operserv/os_news.cpp16
-rw-r--r--modules/operserv/os_session.cpp22
-rw-r--r--modules/operserv/os_set.cpp2
-rw-r--r--modules/operserv/os_shutdown.cpp18
-rw-r--r--modules/operserv/os_stats.cpp6
-rw-r--r--modules/operserv/os_sxline.cpp26
-rw-r--r--modules/protocol/hybrid.cpp2
-rw-r--r--modules/protocol/inspircd.cpp6
-rw-r--r--modules/proxyscan.cpp34
-rw-r--r--modules/redis.cpp16
-rw-r--r--modules/regex_stdlib.cpp6
-rw-r--r--modules/rewrite.cpp16
-rw-r--r--modules/rpc/jsonrpc.cpp4
-rw-r--r--modules/sasl.cpp8
-rw-r--r--modules/sql_authentication.cpp12
-rw-r--r--modules/sql_log.cpp6
-rw-r--r--modules/sql_oper.cpp8
-rw-r--r--modules/webcpanel/pages/register.cpp2
-rw-r--r--modules/webcpanel/webcpanel.cpp8
108 files changed, 638 insertions, 635 deletions
diff --git a/modules/botserv/botserv.cpp b/modules/botserv/botserv.cpp
index 0646668be..e77ffe46c 100644
--- a/modules/botserv/botserv.cpp
+++ b/modules/botserv/botserv.cpp
@@ -23,9 +23,9 @@ public:
{
}
- void OnReload(Configuration::Conf *conf) override
+ void OnReload(Configuration::Conf &conf) override
{
- const Anope::string &bsnick = conf->GetModule(this)->Get<const Anope::string>("client");
+ const Anope::string &bsnick = conf.GetModule(this).Get<const Anope::string>("client");
BotServ = BotInfo::Find(bsnick, true);
}
@@ -34,7 +34,7 @@ public:
/* Do not allow removing bot modes on our service bots */
if (chan->ci && chan->ci->bi == user)
{
- const Anope::string &botmodes = Config->GetModule(this)->Get<const Anope::string>("botmodes");
+ const Anope::string &botmodes = Config->GetModule(this).Get<const Anope::string>("botmodes");
for (auto botmode : botmodes)
chan->SetMode(chan->ci->bi, ModeManager::FindChannelModeByChar(botmode), chan->ci->bi->GetUID());
}
@@ -42,9 +42,9 @@ public:
void OnBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) override
{
- if (ci->c && ci->c->users.size() >= Config->GetModule(this)->Get<unsigned>("minusers"))
+ if (ci->c && ci->c->users.size() >= Config->GetModule(this).Get<unsigned>("minusers"))
{
- ChannelStatus status(Config->GetModule(this)->Get<const Anope::string>("botmodes"));
+ ChannelStatus status(Config->GetModule(this).Get<const Anope::string>("botmodes"));
bi->Join(ci->c, &status);
}
}
@@ -55,7 +55,7 @@ public:
return;
BotInfo *bi = user->server == Me ? dynamic_cast<BotInfo *>(user) : NULL;
- if (bi && Config->GetModule(this)->Get<bool>("smartjoin"))
+ if (bi && Config->GetModule(this).Get<bool>("smartjoin"))
{
if (IRCD->CanClearBans)
{
@@ -99,9 +99,9 @@ public:
* legit users - Rob
**/
/* This is before the user has joined the channel, so check usercount + 1 */
- if (c->users.size() + 1 >= Config->GetModule(this)->Get<unsigned>("minusers") && !c->FindUser(c->ci->bi))
+ if (c->users.size() + 1 >= Config->GetModule(this).Get<unsigned>("minusers") && !c->FindUser(c->ci->bi))
{
- ChannelStatus status(Config->GetModule(this)->Get<const Anope::string>("botmodes"));
+ ChannelStatus status(Config->GetModule(this).Get<const Anope::string>("botmodes"));
c->ci->bi->Join(c, &status);
}
}
@@ -124,7 +124,7 @@ public:
return;
/* This is called prior to removing the user from the channel, so c->users.size() - 1 should be safe */
- if (c->ci && c->ci->bi && u != *c->ci->bi && c->users.size() - 1 <= Config->GetModule(this)->Get<unsigned>("minusers") && c->FindUser(c->ci->bi))
+ if (c->ci && c->ci->bi && u != *c->ci->bi && c->users.size() - 1 <= Config->GetModule(this).Get<unsigned>("minusers") && c->FindUser(c->ci->bi))
c->ci->bi->Part(c->ci->c);
}
@@ -140,7 +140,7 @@ public:
"channel, and provide a more convenient way to execute commands. Commands that\n"
"require a channel as a parameter will automatically have that parameter\n"
"given.\n"), source.service->nick.c_str());
- const Anope::string &fantasycharacters = Config->GetModule("fantasy")->Get<const Anope::string>("fantasycharacter", "!");
+ const Anope::string &fantasycharacters = Config->GetModule("fantasy").Get<const Anope::string>("fantasycharacter", "!");
if (!fantasycharacters.empty())
source.Reply(_(" \n"
"Fantasy commands may be prefixed with one of the following characters: %s\n"), fantasycharacters.c_str());
@@ -170,8 +170,8 @@ public:
source.Reply(_(" \n"
"Bot will join a channel whenever there is at least\n"
- "\002%d\002 user(s) on it."), Config->GetModule(this)->Get<unsigned>("minusers"));
- const Anope::string &fantasycharacters = Config->GetModule("fantasy")->Get<const Anope::string>("fantasycharacter", "!");
+ "\002%d\002 user(s) on it."), Config->GetModule(this).Get<unsigned>("minusers"));
+ const Anope::string &fantasycharacters = Config->GetModule("fantasy").Get<const Anope::string>("fantasycharacter", "!");
if (!fantasycharacters.empty())
source.Reply(_("Additionally, if fantasy is enabled fantasy commands\n"
"can be executed by prefixing the command name with\n"
@@ -180,7 +180,7 @@ public:
EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string &param) override
{
- if (source.GetUser() && !source.GetBot() && Config->GetModule(this)->Get<bool>("smartjoin") && mode->name == "BAN" && c->ci && c->ci->bi && c->FindUser(c->ci->bi))
+ if (source.GetUser() && !source.GetBot() && Config->GetModule(this).Get<bool>("smartjoin") && mode->name == "BAN" && c->ci && c->ci->bi && c->FindUser(c->ci->bi))
{
BotInfo *bi = c->ci->bi;
@@ -195,7 +195,7 @@ public:
void OnCreateChan(ChannelInfo *ci) override
{
/* Set default bot flags */
- spacesepstream sep(Config->GetModule(this)->Get<const Anope::string>("defaults", "greet fantasy"));
+ spacesepstream sep(Config->GetModule(this).Get<const Anope::string>("defaults", "greet fantasy"));
for (Anope::string token; sep.GetToken(token);)
ci->Extend<bool>("BS_" + token.upper());
}
@@ -211,7 +211,7 @@ public:
void OnCreateBot(BotInfo *bi) override
{
if (bi->botmodes.empty())
- bi->botmodes = Config->GetModule(this)->Get<const Anope::string>("botumodes");
+ bi->botmodes = Config->GetModule(this).Get<const Anope::string>("botumodes");
}
};
diff --git a/modules/botserv/bs_autoassign.cpp b/modules/botserv/bs_autoassign.cpp
index e988540fe..5292f8642 100644
--- a/modules/botserv/bs_autoassign.cpp
+++ b/modules/botserv/bs_autoassign.cpp
@@ -19,7 +19,7 @@ public:
void OnChanRegistered(ChannelInfo *ci) override
{
- const Anope::string &bot = Config->GetModule(this)->Get<const Anope::string>("bot");
+ const Anope::string &bot = Config->GetModule(this).Get<const Anope::string>("bot");
if (bot.empty())
return;
diff --git a/modules/botserv/bs_badwords.cpp b/modules/botserv/bs_badwords.cpp
index 5301fd042..95f749488 100644
--- a/modules/botserv/bs_badwords.cpp
+++ b/modules/botserv/bs_badwords.cpp
@@ -286,14 +286,14 @@ private:
realword = word.substr(0, pos);
}
- unsigned badwordsmax = Config->GetModule(this->module)->Get<unsigned>("badwordsmax");
+ unsigned badwordsmax = Config->GetModule(this->module).Get<unsigned>("badwordsmax");
if (badwords->GetBadWordCount() >= badwordsmax)
{
source.Reply(_("Sorry, you can only have %d bad words entries on a channel."), badwordsmax);
return;
}
- bool casesensitive = Config->GetModule(this->module)->Get<bool>("casesensitive");
+ bool casesensitive = Config->GetModule(this->module).Get<bool>("casesensitive");
for (unsigned i = 0, end = badwords->GetBadWordCount(); i < end; ++i)
{
diff --git a/modules/botserv/bs_kick.cpp b/modules/botserv/bs_kick.cpp
index caaa51b01..eba2868a6 100644
--- a/modules/botserv/bs_kick.cpp
+++ b/modules/botserv/bs_kick.cpp
@@ -515,8 +515,8 @@ public:
if (kd->floodsecs < 1)
kd->floodsecs = 10;
- if (kd->floodsecs > Config->GetModule(me)->Get<time_t>("keepdata"))
- kd->floodsecs = Config->GetModule(me)->Get<time_t>("keepdata");
+ if (kd->floodsecs > Config->GetModule(me).Get<time_t>("keepdata"))
+ kd->floodsecs = Config->GetModule(me).Get<time_t>("keepdata");
kd->flood = true;
if (kd->ttb[TTB_FLOOD])
@@ -913,7 +913,7 @@ public:
void purge()
{
- time_t keepdata = Config->GetModule(me)->Get<time_t>("keepdata");
+ time_t keepdata = Config->GetModule(me).Get<time_t>("keepdata");
fo