From b5404f841552f756f6a319c5957c32ffbd3d52b9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 23 Jan 2023 00:08:26 +0000 Subject: Move duration functions to their own header. --- src/modules/m_dccallow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/modules/m_dccallow.cpp') 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 { -- cgit v1.3.1-10-gc9f91