From dac52889545cb71e006a1934668db91554f96822 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 7 May 2020 23:31:22 +0100 Subject: Implement support for inverted extbans. --- src/modules/m_banexception.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/modules/m_banexception.cpp') 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; } -- cgit v1.3.1-10-gc9f91