diff options
author | Sadie Powell <sadie@witchery.services> | 2020-04-04 11:49:06 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-04-04 12:31:14 +0100 |
commit | cbe5b993142c218e09ae972bdce91681cc0ba485 (patch) | |
tree | 61e925088e25c4ba7e1e011929fb13555400c42a /src/modules/m_nonotice.cpp | |
parent | cad2f3f979b2fc45bcfa7c7b7652bbe201a5b0a0 (diff) |
Add the Numerics::CannotSendTo class and switch stuff to use it.
Diffstat (limited to 'src/modules/m_nonotice.cpp')
-rw-r--r-- | src/modules/m_nonotice.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
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; } } |