aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_timedbans.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-04-16 16:16:29 +0100
committerGravatar Sadie Powell2022-04-16 16:16:29 +0100
commit30edd1070df3ddb2ae64b61b65c25f88a0b61e49 (patch)
tree85b33545d32405f7d531bfac2d0b991a6eba3e70 /src/modules/m_timedbans.cpp
parentFix the command used to retrieve the number of cores on Alpine. (diff)
parentBump peter-evans/create-pull-request from 3 to 4 (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_timedbans.cpp')
-rw-r--r--src/modules/m_timedbans.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index d8320c58c..44009f6ac 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -92,7 +92,7 @@ public:
unsigned int cm = channel->GetPrefixValue(user);
if (cm < HALFOP_VALUE)
{
- user->WriteNumeric(ERR_CHANOPRIVSNEEDED, channel->name, "You do not have permission to set bans on this channel");
+ user->WriteNumeric(Numerics::ChannelPrivilegesNeeded(channel, HALFOP_VALUE, "set timed bans"));
return CmdResult::FAILURE;
}
@@ -151,8 +151,8 @@ public:
mask.c_str(), user->nick.c_str(), channel->name.c_str(), InspIRCd::DurationString(duration).c_str());
// If halfop is loaded, send notice to halfops and above, otherwise send to ops and above
- PrefixMode* mh = ServerInstance->Modes.FindPrefixMode('h');
- char pfxchar = (mh && mh->name == "halfop") ? mh->GetPrefix() : '@';
+ PrefixMode* mh = ServerInstance->Modes.FindNearestPrefixMode(HALFOP_VALUE);
+ char pfxchar = mh ? mh->GetPrefix() : '@';
channel->WriteRemoteNotice(message, pfxchar);
}
@@ -256,8 +256,8 @@ public:
timedban.mask.c_str(), timedban.setter.c_str(), timedban.chan->name.c_str());
// If halfop is loaded, send notice to halfops and above, otherwise send to ops and above
- PrefixMode* mh = ServerInstance->Modes.FindPrefixMode('h');
- char pfxchar = (mh && mh->name == "halfop") ? mh->GetPrefix() : '@';
+ PrefixMode* mh = ServerInstance->Modes.FindNearestPrefixMode(HALFOP_VALUE);
+ char pfxchar = mh ? mh->GetPrefix() : '@';
timedban.chan->WriteRemoteNotice(message, pfxchar);
}