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/protocol.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/protocol.cpp') diff --git a/src/protocol.cpp b/src/protocol.cpp index c66f87653..a45985a0d 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -25,10 +25,10 @@ IRCDProto *IRCD = NULL; IRCDProto::IRCDProto(Module *creator, const Anope::string &p) : Service(creator, "IRCDProto", creator->name) , proto_name(p) - , MaxChannel(Config->GetBlock("networkinfo")->Get("chanlen", "32")) - , MaxHost(Config->GetBlock("networkinfo")->Get("hostlen", "64")) - , MaxNick(Config->GetBlock("networkinfo")->Get("nicklen", "31")) - , MaxUser(Config->GetBlock("networkinfo")->Get("userlen", "10")) + , MaxChannel(Config->GetBlock("networkinfo").Get("chanlen", "32")) + , MaxHost(Config->GetBlock("networkinfo").Get("hostlen", "64")) + , MaxNick(Config->GetBlock("networkinfo").Get("nicklen", "31")) + , MaxUser(Config->GetBlock("networkinfo").Get("userlen", "10")) { if (IRCD == NULL) IRCD = this; @@ -76,7 +76,7 @@ Anope::string IRCDProto::SID_Retrieve() if (!IRCD || !IRCD->RequiresID) return ""; - static Anope::string current_sid = Config->GetBlock("serverinfo")->Get("id"); + static Anope::string current_sid = Config->GetBlock("serverinfo").Get("id"); if (current_sid.empty()) current_sid = "00A"; @@ -289,8 +289,8 @@ bool IRCDProto::IsHostValid(const Anope::string &host) if (host.empty() || host.length() > IRCD->MaxHost) return false; - const Anope::string &vhostdisablebe = Config->GetBlock("networkinfo")->Get("disallow_start_or_end"), - vhostchars = Config->GetBlock("networkinfo")->Get("vhost_chars"); + const Anope::string &vhostdisablebe = Config->GetBlock("networkinfo").Get("disallow_start_or_end"), + vhostchars = Config->GetBlock("networkinfo").Get("vhost_chars"); if (vhostdisablebe.find_first_of(host[0]) != Anope::string::npos) return false; @@ -306,7 +306,7 @@ bool IRCDProto::IsHostValid(const Anope::string &host) return false; } - return dots > 0 || Config->GetBlock("networkinfo")->Get("allow_undotted_vhosts"); + return dots > 0 || Config->GetBlock("networkinfo").Get("allow_undotted_vhosts"); } void IRCDProto::SendOper(User *u) @@ -317,7 +317,7 @@ void IRCDProto::SendOper(User *u) size_t IRCDProto::GetMaxListFor(Channel *c, ChannelMode *cm) { - return c->HasMode("LBAN") ? 0 : Config->GetBlock("networkinfo")->Get("modelistsize", "100"); + return c->HasMode("LBAN") ? 0 : Config->GetBlock("networkinfo").Get("modelistsize", "100"); } Anope::string IRCDProto::NormalizeMask(const Anope::string &mask) -- cgit