summaryrefslogtreecommitdiff
path: root/src/coremods
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/coremods
parentcad2f3f979b2fc45bcfa7c7b7652bbe201a5b0a0 (diff)
Add the Numerics::CannotSendTo class and switch stuff to use it.
Diffstat (limited to 'src/coremods')
-rw-r--r--src/coremods/core_message.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/coremods/core_message.cpp b/src/coremods/core_message.cpp
index 1093aad67..b4404995d 100644
--- a/src/coremods/core_message.cpp
+++ b/src/coremods/core_message.cpp
@@ -408,7 +408,7 @@ class ModuleCoreMessage : public Module
if (chan->IsModeSet(noextmsgmode) && !chan->HasUser(user))
{
// The noextmsg mode is set and the user is not in the channel.
- user->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (no external messages)");
+ user->WriteNumeric(Numerics::CannotSendTo(chan, "external messages", *noextmsgmode));
return MOD_RES_DENY;
}
@@ -416,7 +416,7 @@ class ModuleCoreMessage : public Module
if (no_chan_priv && chan->IsModeSet(moderatedmode))
{
// The moderated mode is set and the user has no status rank.
- user->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (+m is set)");
+ user->WriteNumeric(Numerics::CannotSendTo(chan, "messages", *moderatedmode));
return MOD_RES_DENY;
}
@@ -424,7 +424,7 @@ class ModuleCoreMessage : public Module
{
// The user is banned in the channel and restrictbannedusers is enabled.
if (ServerInstance->Config->RestrictBannedUsers == ServerConfig::BUT_RESTRICT_NOTIFY)
- user->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (you're banned)");
+ user->WriteNumeric(Numerics::CannotSendTo(chan, "You cannot send messages to this channel whilst banned."));
return MOD_RES_DENY;
}