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 /modules/sasl.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 'modules/sasl.cpp')
-rw-r--r-- | modules/sasl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/sasl.cpp b/modules/sasl.cpp index 63b90fc8c..795a76bf3 100644 --- a/modules/sasl.cpp +++ b/modules/sasl.cpp @@ -250,7 +250,7 @@ public: Anope::string GetAgent() override { - Anope::string agent = Config->GetModule(Service::owner)->Get<Anope::string>("agent", "NickServ"); + Anope::string agent = Config->GetModule(Service::owner).Get<Anope::string>("agent", "NickServ"); BotInfo *bi = Config->GetClient(agent); if (bi) agent = bi->GetUID(); @@ -326,7 +326,7 @@ public: return; } - const auto badpasslimit = Config->GetBlock("options")->Get<int>("badpasslimit"); + const auto badpasslimit = Config->GetBlock("options").Get<int>("badpasslimit"); if (!badpasslimit) return; @@ -335,7 +335,7 @@ public: it = badpasswords.emplace(session->uid, std::make_pair(0, 0)).first; auto &[invalid_pw_time, invalid_pw_count] = it->second; - const auto badpasstimeout = Config->GetBlock("options")->Get<time_t>("badpasstimeout"); + const auto badpasstimeout = Config->GetBlock("options").Get<time_t>("badpasstimeout"); if (badpasstimeout > 0 && invalid_pw_time > 0 && invalid_pw_time < Anope::CurTime - badpasstimeout) invalid_pw_count = 0; @@ -360,7 +360,7 @@ public: void Tick() override { - const auto badpasstimeout = Config->GetBlock("options")->Get<time_t>("badpasstimeout"); + const auto badpasstimeout = Config->GetBlock("options").Get<time_t>("badpasstimeout"); for (auto it = badpasswords.begin(); it != badpasswords.end(); ) { if (it->second.first + badpasstimeout < Anope::CurTime) |