diff options
author | Sadie Powell <sadie@witchery.services> | 2025-03-02 14:51:02 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-03-02 15:27:47 +0000 |
commit | f9911dde529adf3dc03f4f14bbd70756ac2f665c (patch) | |
tree | 7c720e4f82fdb30b7d8a22fc0809f50bc862fae3 /src/messages.cpp | |
parent | a5e5eb5eb084e8343260ce7bc26ea86798f64fe1 (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 'src/messages.cpp')
-rw-r--r-- | src/messages.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/messages.cpp b/src/messages.cpp index ddc6ec380..391b3d330 100644 --- a/src/messages.cpp +++ b/src/messages.cpp @@ -237,7 +237,7 @@ void MOTD::Run(MessageSource &source, const std::vector<Anope::string> ¶ms, if (s != Me) return; - auto motdfile = Anope::ExpandConfig(Config->GetBlock("serverinfo")->Get<const Anope::string>("motd")); + auto motdfile = Anope::ExpandConfig(Config->GetBlock("serverinfo").Get<const Anope::string>("motd")); std::ifstream stream(motdfile.str()); if (!stream.is_open()) { @@ -405,7 +405,7 @@ void Stats::Run(MessageSource &source, const std::vector<Anope::string> ¶ms, case 'o': case 'O': /* Check whether the user is an operator */ - if (!u->HasMode("OPER") && Config->GetBlock("options")->Get<bool>("hidestatso")) + if (!u->HasMode("OPER") && Config->GetBlock("options").Get<bool>("hidestatso")) IRCD->SendNumeric(RPL_STATSLINKINFO, source.GetSource(), params[0][0], "End of /STATS report."); else { @@ -473,7 +473,7 @@ void Whois::Run(MessageSource &source, const std::vector<Anope::string> ¶ms, IRCD->SendNumeric(RPL_WHOISUSER, source.GetSource(), u->nick, u->GetIdent(), u->host, '*', u->realname); if (bi) IRCD->SendNumeric(RPL_WHOISREGNICK, source.GetSource(), bi->nick, "is a registered nick"); - IRCD->SendNumeric(RPL_WHOISSERVER, source.GetSource(), u->nick, Me->GetName(), Config->GetBlock("serverinfo")->Get<const Anope::string>("description")); + IRCD->SendNumeric(RPL_WHOISSERVER, source.GetSource(), u->nick, Me->GetName(), Config->GetBlock("serverinfo").Get<const Anope::string>("description")); if (bi) IRCD->SendNumeric(RPL_WHOISIDLE, source.GetSource(), bi->nick, Anope::CurTime - bi->lastmsg, bi->signon, "seconds idle, signon time"); IRCD->SendNumeric(RPL_WHOISOPERATOR, source.GetSource(), u->nick, "is a Network Service"); |