From 57a4eca963044d4ed8c586f7cbb0d0977bf1c2bd Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 25 Feb 2024 22:20:02 +0000 Subject: Fix erroneously sending RPL_CHANNELSMSG when a whois chanlist is blocked. --- src/modules/m_hidechans.cpp | 2 +- src/modules/m_servprotect.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_hidechans.cpp b/src/modules/m_hidechans.cpp index 91048e971..250915fe2 100644 --- a/src/modules/m_hidechans.cpp +++ b/src/modules/m_hidechans.cpp @@ -82,7 +82,7 @@ class ModuleHideChans CXX11_FINAL ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) CXX11_OVERRIDE { - if (numeric.GetNumeric() != RPL_WHOISCHANNELS) + if (numeric.GetNumeric() != RPL_WHOISCHANNELS && numeric.GetNumeric() != RPL_CHANNELSMSG) return MOD_RES_PASSTHRU; return ShouldHideChans(whois.GetSource(), whois.GetTarget()); diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index 6b8f5c3e5..7405b69e2 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -129,7 +129,10 @@ class ModuleServProtectMode CXX11_FINAL ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) CXX11_OVERRIDE { - return ((numeric.GetNumeric() == RPL_WHOISCHANNELS) && whois.GetTarget()->IsModeSet(bm)) ? MOD_RES_DENY : MOD_RES_PASSTHRU; + if (numeric.GetNumeric() != RPL_WHOISCHANNELS && numeric.GetNumeric() != RPL_CHANNELSMSG) + return MOD_RES_PASSTHRU; + + return whois.GetTarget()->IsModeSet(bm) ? MOD_RES_DENY : MOD_RES_PASSTHRU; } }; -- cgit v1.3.1-10-gc9f91