From f9911dde529adf3dc03f4f14bbd70756ac2f665c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 2 Mar 2025 14:51:02 +0000 Subject: 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. --- src/messages.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/messages.cpp') 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 ¶ms, if (s != Me) return; - auto motdfile = Anope::ExpandConfig(Config->GetBlock("serverinfo")->Get("motd")); + auto motdfile = Anope::ExpandConfig(Config->GetBlock("serverinfo").Get("motd")); std::ifstream stream(motdfile.str()); if (!stream.is_open()) { @@ -405,7 +405,7 @@ void Stats::Run(MessageSource &source, const std::vector ¶ms, case 'o': case 'O': /* Check whether the user is an operator */ - if (!u->HasMode("OPER") && Config->GetBlock("options")->Get("hidestatso")) + if (!u->HasMode("OPER") && Config->GetBlock("options").Get("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 ¶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("description")); + IRCD->SendNumeric(RPL_WHOISSERVER, source.GetSource(), u->nick, Me->GetName(), Config->GetBlock("serverinfo").Get("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"); -- cgit