aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_timedbans.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-23 00:08:26 +0000
committerGravatar Sadie Powell2023-01-23 01:01:06 +0000
commitb5404f841552f756f6a319c5957c32ffbd3d52b9 (patch)
tree214f804df03d7ea7994ca7ce52764f3741c61ba4 /src/modules/m_timedbans.cpp
parentMove NotifyRawIO to the Log namespace. (diff)
Move duration functions to their own header.
Diffstat (limited to 'src/modules/m_timedbans.cpp')
-rw-r--r--src/modules/m_timedbans.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index e405d7584..db41acaff 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -30,6 +30,7 @@
#include "inspircd.h"
+#include "duration.h"
#include "listmode.h"
#include "modules/extban.h"
#include "numerichelper.h"
@@ -102,7 +103,7 @@ public:
TimedBan T;
unsigned long duration;
- if (!InspIRCd::Duration(parameters[1], duration))
+ if (!Duration::TryFrom(parameters[1], duration))
{
user->WriteNotice("Invalid ban time");
return CmdResult::FAILURE;
@@ -151,7 +152,7 @@ public:
if (sendnotice)
{
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());
+ mask.c_str(), user->nick.c_str(), channel->name.c_str(), Duration::ToString(duration).c_str());
// If halfop is loaded, send notice to halfops and above, otherwise send to ops and above
PrefixMode* mh = ServerInstance->Modes.FindNearestPrefixMode(HALFOP_VALUE);