aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-04-12 21:42:14 +0100
committerGravatar Sadie Powell2022-04-12 21:42:14 +0100
commit73a4b470b27872f77922a75a323cc1bab1cae06e (patch)
tree840093092da5a5eb069a73845f386016fcb19fd0 /src
parentAdd a numeric builder for the ERR_CHANOPRIVSNEEDED numeric. (diff)
Use FindNearestPrefixMode instead of looking for the halfop mode.
Diffstat (limited to 'src')
-rw-r--r--src/coremods/core_channel/cmd_invite.cpp4
-rw-r--r--src/modules/m_timedbans.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/coremods/core_channel/cmd_invite.cpp b/src/coremods/core_channel/cmd_invite.cpp
index 81b56f949..a83fe1c1e 100644
--- a/src/coremods/core_channel/cmd_invite.cpp
+++ b/src/coremods/core_channel/cmd_invite.cpp
@@ -161,8 +161,8 @@ CmdResult CommandInvite::Handle(User* user, const Params& parameters)
case Invite::ANNOUNCE_DYNAMIC:
{
- PrefixMode* mh = ServerInstance->Modes->FindPrefixMode('h');
- if ((mh) && (mh->name == "halfop"))
+ PrefixMode* mh = ServerInstance->Modes.FindNearestPrefixMode(HALFOP_VALUE);
+ if (mh)
{
prefix = mh->GetPrefix();
minrank = mh->GetPrefixRank();
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index 20ce1615a..6c442bba0 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -152,8 +152,8 @@ class CommandTban : public Command
const std::string message = InspIRCd::Format("Timed ban %s added by %s on %s lasting for %s.",
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 @@ class ModuleTimedBans : public Module
const std::string message = InspIRCd::Format("Timed ban %s set by %s on %s has expired.",
mask.c_str(), i->setter.c_str(), cr->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() : '@';
cr->WriteRemoteNotice(message, pfxchar);
}