aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_timedbans.cpp
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/modules/m_timedbans.cpp
parentAdd a numeric builder for the ERR_CHANOPRIVSNEEDED numeric. (diff)
Use FindNearestPrefixMode instead of looking for the halfop mode.
Diffstat (limited to 'src/modules/m_timedbans.cpp')
-rw-r--r--src/modules/m_timedbans.cpp8
1 files changed, 4 insertions, 4 deletions
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);
}