summaryrefslogtreecommitdiff
path: root/src/modules/m_blockcolor.cpp
diff options
context:
space:
mode:
authorMatt Schatz <genius3000@g3k.solutions>2019-11-18 03:21:19 -0700
committerP. Powell <petpow@saberuk.com>2019-11-18 11:18:00 +0000
commit7ae4ca1a238ba7598ce2cd1b3de116cfc7a89588 (patch)
treefd9fae72d469aabcd249b2ccc59ee27ccbf840cb /src/modules/m_blockcolor.cpp
parent36d7ee44a8c697a702211bb767d7a5c912300dfd (diff)
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.
Diffstat (limited to 'src/modules/m_blockcolor.cpp')
-rw-r--r--src/modules/m_blockcolor.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp
index 25345506e..b514d3a1d 100644
--- a/src/modules/m_blockcolor.cpp
+++ b/src/modules/m_blockcolor.cpp
@@ -46,19 +46,21 @@ class ModuleBlockColor : public Module
if ((target.type == MessageTarget::TYPE_CHANNEL) && (IS_LOCAL(user)))
{
Channel* c = target.Get<Channel>();
- ModResult res = CheckExemption::Call(exemptionprov, user, c, "blockcolor");
+ ModResult res = CheckExemption::Call(exemptionprov, user, c, "blockcolor");
if (res == MOD_RES_ALLOW)
return MOD_RES_PASSTHRU;
- if (!c->GetExtBanStatus(user, 'c').check(!c->IsModeSet(bc)))
+ bool modeset = c->IsModeSet(bc);
+ if (!c->GetExtBanStatus(user, 'c').check(!modeset))
{
for (std::string::iterator i = details.text.begin(); i != details.text.end(); i++)
{
// Block all control codes except \001 for CTCP
if ((*i >= 0) && (*i < 32) && (*i != 1))
{
- user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, "Can't send colors to channel (+c is set)");
+ user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, InspIRCd::Format("Can't send colors to channel (%s)",
+ modeset ? "+c is set" : "you're extbanned"));
return MOD_RES_DENY;
}
}