From cbe5b993142c218e09ae972bdce91681cc0ba485 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 4 Apr 2020 11:49:06 +0100 Subject: Add the Numerics::CannotSendTo class and switch stuff to use it. --- src/modules/m_nonotice.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/modules/m_nonotice.cpp') diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp index bff5bba2d..4ee5f8bff 100644 --- a/src/modules/m_nonotice.cpp +++ b/src/modules/m_nonotice.cpp @@ -55,11 +55,15 @@ class ModuleNoNotice : public Module if (res == MOD_RES_ALLOW) return MOD_RES_PASSTHRU; - bool modeset = c->IsModeSet(nt); - if (!c->GetExtBanStatus(user, 'T').check(!modeset)) + if (c->IsModeSet(nt)) { - user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, InspIRCd::Format("Can't send NOTICE to channel (%s)", - modeset ? "+T is set" : "you're extbanned")); + user->WriteNumeric(Numerics::CannotSendTo(c, "notices", &nt)); + return MOD_RES_DENY; + } + + if (c->GetExtBanStatus(user, 'T') == MOD_RES_DENY) + { + user->WriteNumeric(Numerics::CannotSendTo(c, "notices", 'T', "nonotice")); return MOD_RES_DENY; } } -- cgit v1.3.1-10-gc9f91