aboutsummaryrefslogtreecommitdiffstats
path: root/modules/helpmode.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-07-10 11:15:52 +0100
committerGravatar Sadie Powell2026-07-10 11:58:06 +0100
commit5f9c2b3c97ed1eeb19270fd3582b71ca8e1ca1ac (patch)
treea6d3d38e04f30b0906141f49d4e0fd643be1d0d9 /modules/helpmode.cpp
parentConvert TLS::IOHook::Status to an enum class. (diff)
Use saturating adds/subtracts when handling timestamps.
Diffstat (limited to 'modules/helpmode.cpp')
-rw-r--r--modules/helpmode.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/helpmode.cpp b/modules/helpmode.cpp
index abf46016d..4db098f4c 100644
--- a/modules/helpmode.cpp
+++ b/modules/helpmode.cpp
@@ -112,7 +112,7 @@ public:
std::string extra;
if (helper->IsAway())
{
- const std::string awayperiod = Duration::ToLongString(ServerInstance->Time() - helper->away->time, true);
+ const std::string awayperiod = Duration::ToLongString(Time::Ago(helper->away->time), true);
const std::string awaytime = Time::ToString(helper->away->time);
extra = FMT::format(": away for {} [since {}] ({})", awayperiod, awaytime, helper->away->message);
@@ -121,7 +121,7 @@ public:
auto* lhelper = helper->AsLocal();
if (lhelper)
{
- const std::string idleperiod = Duration::ToLongString(ServerInstance->Time() - lhelper->idle_lastmsg, true);
+ const std::string idleperiod = Duration::ToLongString(Time::Ago(lhelper->idle_lastmsg), true);
const std::string idletime = Time::ToString(lhelper->idle_lastmsg);
extra += FMT::format("{} idle for {} [since {}]", extra.empty() ? ':' : ',', idleperiod, idletime);