From ee44af8d04f23b4a16c9b377764f930d69e575f7 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 27 Nov 2022 07:32:42 +0000 Subject: Refactor the internals of the oper system. - Allow overriding privileges from the blocks in the and blocks. - Separate oper types from oper accounts in the code. This enables moving some core stuff out of the config tag later. - Merge the config tags together to make a synthetic tag that can have getXXX called on it instead of using getConfig and then converting it. - Move the details of Have*Permission into the oper type class. - Improve oper events to allow modules to easily hook into the oper system. --- src/modules/m_swhois.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/modules/m_swhois.cpp') diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index 99f9007d0..06e101746 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -116,13 +116,12 @@ public: return MOD_RES_PASSTHRU; } - void OnPostOper(User* user) override + void OnPostOperLogin(User* user) override { if (!IS_LOCAL(user)) return; - std::string swhois = user->oper->getConfig("swhois"); - + const std::string swhois = user->oper->GetConfig()->getString("swhois"); if (!swhois.length()) return; @@ -130,7 +129,7 @@ public: cmd.swhois.Set(user, swhois); } - void OnPostDeoper(User* user) override + void OnPostOperLogout(User* user, const std::shared_ptr& oper) override { std::string* swhois = cmd.swhois.Get(user); if (!swhois) -- cgit v1.3.1-10-gc9f91