From c0bc5bf7981e30229bdabfdf51a289635fe8be76 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 16 Apr 2022 11:48:08 +0100 Subject: Add ListModeBase::CanonicalizeParam, fix cleaning extban masks. --- src/modules/m_banexception.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/modules/m_banexception.cpp') 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 = ""; } + + bool CanonicalizeParam(LocalUser* user, Channel* channel, std::string& parameter) override + { + if (!extbanmgr || !extbanmgr->Canonicalize(parameter)) + ModeParser::CleanMask(parameter); + return true; + } }; class ModuleBanException final -- cgit v1.3.1-10-gc9f91