aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_dccallow.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_dccallow.cpp
parentMove NotifyRawIO to the Log namespace. (diff)
Move duration functions to their own header.
Diffstat (limited to 'src/modules/m_dccallow.cpp')
-rw-r--r--src/modules/m_dccallow.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index 67e28c93b..b346c8641 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -30,6 +30,7 @@
#include "inspircd.h"
+#include "duration.h"
#include "extension.h"
#include "numerichelper.h"
@@ -301,14 +302,14 @@ public:
{
length = defaultlength;
}
- else if (!InspIRCd::IsValidDuration(parameters[1]))
+ else if (!Duration::IsValid(parameters[1]))
{
user->WriteNumeric(ERR_DCCALLOWINVALID, user->nick, InspIRCd::Format("%s is not a valid DCCALLOW duration", parameters[1].c_str()));
return CmdResult::FAILURE;
}
else
{
- if (!InspIRCd::Duration(parameters[1], length))
+ if (!Duration::TryFrom(parameters[1], length))
{
user->WriteNotice("*** Invalid duration for DCC allow");
return CmdResult::FAILURE;
@@ -324,7 +325,7 @@ public:
if (length > 0)
{
- user->WriteNumeric(RPL_DCCALLOWTIMED, user->nick, InspIRCd::Format("Added %s to DCCALLOW list for %s", target->nick.c_str(), InspIRCd::DurationString(length).c_str()));
+ user->WriteNumeric(RPL_DCCALLOWTIMED, user->nick, InspIRCd::Format("Added %s to DCCALLOW list for %s", target->nick.c_str(), Duration::ToString(length).c_str()));
}
else
{