summaryrefslogtreecommitdiff
path: root/src/modules/m_noctcp.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-04-04 11:49:06 +0100
committerSadie Powell <sadie@witchery.services>2020-04-04 12:31:14 +0100
commitcbe5b993142c218e09ae972bdce91681cc0ba485 (patch)
tree61e925088e25c4ba7e1e011929fb13555400c42a /src/modules/m_noctcp.cpp
parentcad2f3f979b2fc45bcfa7c7b7652bbe201a5b0a0 (diff)
Add the Numerics::CannotSendTo class and switch stuff to use it.
Diffstat (limited to 'src/modules/m_noctcp.cpp')
-rw-r--r--src/modules/m_noctcp.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp
index f6877f679..4f6545700 100644
--- a/src/modules/m_noctcp.cpp
+++ b/src/modules/m_noctcp.cpp
@@ -88,11 +88,15 @@ class ModuleNoCTCP : public Module
if (res == MOD_RES_ALLOW)
return MOD_RES_PASSTHRU;
- bool modeset = c->IsModeSet(nc);
- if (!c->GetExtBanStatus(user, 'C').check(!modeset))
+ if (c->IsModeSet(nc))
{
- user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, InspIRCd::Format("Can't send CTCP to channel (%s)",
- modeset ? "+C is set" : "you're extbanned"));
+ user->WriteNumeric(Numerics::CannotSendTo(c, "CTCPs", &nc));
+ return MOD_RES_DENY;
+ }
+
+ if (c->GetExtBanStatus(user, 'C') == MOD_RES_DENY)
+ {
+ user->WriteNumeric(Numerics::CannotSendTo(c, "CTCPs", 'C', "noctcp"));
return MOD_RES_DENY;
}
break;
@@ -105,7 +109,7 @@ class ModuleNoCTCP : public Module
User* u = target.Get<User>();
if (u->IsModeSet(ncu))
{
- user->WriteNumeric(ERR_CANTSENDTOUSER, u->nick, "Can't send CTCP to user (+T is set)");
+ user->WriteNumeric(Numerics::CannotSendTo(u, "CTCPs", &ncu));
return MOD_RES_DENY;
}
break;