diff options
| author | 2026-03-06 16:52:08 +0000 | |
|---|---|---|
| committer | 2026-03-06 16:52:08 +0000 | |
| commit | 63420af61af656a454b93c7c2f5f2da29d930df9 (patch) | |
| tree | 6f945479a14da68d78ca6fb8e7614a7ac5889ef3 /modules/silence.cpp | |
| parent | Merge branch 'insp4' into master. (diff) | |
Add validation to silence extbans.
Diffstat (limited to 'modules/silence.cpp')
| -rw-r--r-- | modules/silence.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/modules/silence.cpp b/modules/silence.cpp index a3522adab..3584dcc08 100644 --- a/modules/silence.cpp +++ b/modules/silence.cpp @@ -393,7 +393,24 @@ public: if (mask.empty()) mask.assign("*"); } - if (!extbanmgr || !extbanmgr->Canonicalize(mask)) + + auto clean = true; + if (extbanmgr) + { + switch (extbanmgr->Validate(nullptr, user, nullptr, mask)) + { + case ExtBan::Comparison::NOT_AN_EXTBAN: + break; + + case ExtBan::Comparison::MATCH: + clean = false; + break; + + case ExtBan::Comparison::NOT_MATCH: + return CmdResult::FAILURE; // ExtBan is not allowed. + } + } + if (clean) ModeParser::CleanMask(mask); // If the user specified a flags then use that. Otherwise, default to blocking |
