From 7ae4ca1a238ba7598ce2cd1b3de116cfc7a89588 Mon Sep 17 00:00:00 2001 From: Matt Schatz Date: Mon, 18 Nov 2019 03:21:19 -0700 Subject: Split the channel mode and extban replies. Tell the user when they are extbanned rather than incorrectly say that the channel mode is set. Refactored the logic in m_nonotice to match that of the others. --- src/modules/m_nokicks.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/modules/m_nokicks.cpp') diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp index 6cd91c55b..20951c18f 100644 --- a/src/modules/m_nokicks.cpp +++ b/src/modules/m_nokicks.cpp @@ -39,10 +39,12 @@ class ModuleNoKicks : public Module ModResult OnUserPreKick(User* source, Membership* memb, const std::string &reason) CXX11_OVERRIDE { - if (!memb->chan->GetExtBanStatus(source, 'Q').check(!memb->chan->IsModeSet(nk))) + bool modeset = memb->chan->IsModeSet(nk); + if (!memb->chan->GetExtBanStatus(source, 'Q').check(!modeset)) { // Can't kick with Q in place, not even opers with override, and founders - source->WriteNumeric(ERR_CHANOPRIVSNEEDED, memb->chan->name, InspIRCd::Format("Can't kick user %s from channel (+Q is set)", memb->user->nick.c_str())); + source->WriteNumeric(ERR_CHANOPRIVSNEEDED, memb->chan->name, InspIRCd::Format("Can't kick user %s from channel (%s)", + memb->user->nick.c_str(), modeset ? "+Q is set" : "you're extbanned")); return MOD_RES_DENY; } return MOD_RES_PASSTHRU; -- cgit v1.3.1-10-gc9f91