diff options
| author | 2020-05-07 23:31:22 +0100 | |
|---|---|---|
| committer | 2020-05-07 23:45:52 +0100 | |
| commit | dac52889545cb71e006a1934668db91554f96822 (patch) | |
| tree | 54b28e6bd57db8f22e085e1b0f16e31c23aece60 /src/modules/m_banexception.cpp | |
| parent | Deduplicate extban parsing. (diff) | |
Implement support for inverted extbans.
Diffstat (limited to 'src/modules/m_banexception.cpp')
| -rw-r--r-- | src/modules/m_banexception.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp index 7324e7098..c5105ae65 100644 --- a/src/modules/m_banexception.cpp +++ b/src/modules/m_banexception.cpp @@ -73,10 +73,11 @@ class ModuleBanException if (!list) return MOD_RES_PASSTHRU; - for (const ListModeBase::ListItem ban : *list) + for (const ListModeBase::ListItem& ban : *list) { + bool inverted; std::string name, value; - if (!ExtBan::Parse(ban.mask, name, value)) + if (!ExtBan::Parse(ban.mask, name, value, inverted)) continue; if (name.size() == 1) @@ -92,7 +93,7 @@ class ModuleBanException continue; } - return extban->IsMatch(user, chan, value) ? MOD_RES_ALLOW : MOD_RES_PASSTHRU; + return extban->IsMatch(user, chan, value) != inverted ? MOD_RES_ALLOW : MOD_RES_PASSTHRU; } return MOD_RES_PASSTHRU; } |
