diff options
Diffstat (limited to 'include/modules')
| -rw-r--r-- | include/modules/extban.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/modules/extban.h b/include/modules/extban.h index 17c66c031..b90829be9 100644 --- a/include/modules/extban.h +++ b/include/modules/extban.h @@ -73,6 +73,12 @@ public: */ virtual void AddExtBan(Base* extban) = 0; + /** Canonicalises a list mode entry if it is an extban. + * @param text The list mode entry to canonicalize. + * @return True if the text was a valid extban and was canonicalised. Otherwise, false. + */ + virtual bool Canonicalize(std::string& text) const = 0; + /** Unregisters an extban from the manager. * @param extban The extban instance to unregister. */ @@ -151,6 +157,11 @@ protected: } public: + /** Canonicalises a value for this extban. + * @param text The value to canonicalize. + */ + virtual void Canonicalize(std::string& text) { } + /** Retrieves the character used in bans to signify this extban. */ unsigned char GetLetter() const { return letter; } @@ -212,6 +223,13 @@ public: { } + /** @copydoc ExtBan::Base::Canonicalize */ + void Canonicalize(std::string& text) override + { + if (!GetManager() || !GetManager()->Canonicalize(text)) + ModeParser::CleanMask(text); + } + /** @copydoc ExtBan::Base::GetType */ Type GetType() const override { return ExtBan::Type::ACTING; } |
