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_nonicks.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modules/m_nonicks.cpp') diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp index a796495a8..df2d5db64 100644 --- a/src/modules/m_nonicks.cpp +++ b/src/modules/m_nonicks.cpp @@ -50,17 +50,17 @@ class ModuleNoNickChange : public Module Channel* curr = (*i)->chan; ModResult res = CheckExemption::Call(exemptionprov, user, curr, "nonick"); - if (res == MOD_RES_ALLOW) continue; if (user->HasPrivPermission("channels/ignore-nonicks")) continue; - if (!curr->GetExtBanStatus(user, 'N').check(!curr->IsModeSet(nn))) + bool modeset = curr->IsModeSet(nn); + if (!curr->GetExtBanStatus(user, 'N').check(!modeset)) { - user->WriteNumeric(ERR_CANTCHANGENICK, InspIRCd::Format("Cannot change nickname while on %s (+N is set)", - curr->name.c_str())); + user->WriteNumeric(ERR_CANTCHANGENICK, InspIRCd::Format("Can't change nickname while on %s (%s)", + curr->name.c_str(), modeset ? "+N is set" : "you're extbanned")); return MOD_RES_DENY; } } -- cgit v1.3.1-10-gc9f91