From 73a4b470b27872f77922a75a323cc1bab1cae06e Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 12 Apr 2022 21:42:14 +0100 Subject: Use FindNearestPrefixMode instead of looking for the halfop mode. --- src/modules/m_timedbans.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modules/m_timedbans.cpp') 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); } -- cgit v1.3.1-10-gc9f91