diff options
| author | 2022-04-16 11:48:08 +0100 | |
|---|---|---|
| committer | 2022-04-16 12:01:59 +0100 | |
| commit | c0bc5bf7981e30229bdabfdf51a289635fe8be76 (patch) | |
| tree | 9ccf09d595b797e4dcffe0c43c0ad7eb70260f39 /src/modules/m_banexception.cpp | |
| parent | Add a class that wraps a dynamic reference to the extban manager. (diff) | |
Add ListModeBase::CanonicalizeParam, fix cleaning extban masks.
Diffstat (limited to 'src/modules/m_banexception.cpp')
| -rw-r--r-- | src/modules/m_banexception.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp index b81a67b5a..b975ab7c9 100644 --- a/src/modules/m_banexception.cpp +++ b/src/modules/m_banexception.cpp @@ -39,12 +39,23 @@ enum class BanException final : public ListModeBase { +private: + ExtBan::ManagerRef extbanmgr; + public: BanException(Module* Creator) - : ListModeBase(Creator, "banexception", 'e', RPL_EXCEPTLIST, RPL_ENDOFEXCEPTLIST, true) + : ListModeBase(Creator, "banexception", 'e', RPL_EXCEPTLIST, RPL_ENDOFEXCEPTLIST) + , extbanmgr(Creator) { syntax = "<mask>"; } + + bool CanonicalizeParam(LocalUser* user, Channel* channel, std::string& parameter) override + { + if (!extbanmgr || !extbanmgr->Canonicalize(parameter)) + ModeParser::CleanMask(parameter); + return true; + } }; class ModuleBanException final |
