diff options
| author | 2026-07-10 11:15:52 +0100 | |
|---|---|---|
| committer | 2026-07-10 11:58:06 +0100 | |
| commit | 5f9c2b3c97ed1eeb19270fd3582b71ca8e1ca1ac (patch) | |
| tree | a6d3d38e04f30b0906141f49d4e0fd643be1d0d9 /modules/hideoper.cpp | |
| parent | Convert TLS::IOHook::Status to an enum class. (diff) | |
Use saturating adds/subtracts when handling timestamps.
Diffstat (limited to 'modules/hideoper.cpp')
| -rw-r--r-- | modules/hideoper.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/hideoper.cpp b/modules/hideoper.cpp index 321d3cd45..4db2467d8 100644 --- a/modules/hideoper.cpp +++ b/modules/hideoper.cpp @@ -155,7 +155,7 @@ public: std::string extra; if (oper->IsAway()) { - const std::string awayperiod = Duration::ToLongString(ServerInstance->Time() - oper->away->time, true); + const std::string awayperiod = Duration::ToLongString(Time::Ago(oper->away->time), true); const std::string awaytime = Time::ToString(oper->away->time); extra = FMT::format(": away for {} [since {}] ({})", awayperiod, awaytime, oper->away->message); @@ -164,7 +164,7 @@ public: auto* loper = oper->AsLocal(); if (loper) { - const std::string idleperiod = Duration::ToLongString(ServerInstance->Time() - loper->idle_lastmsg, true); + const std::string idleperiod = Duration::ToLongString(Time::Ago(loper->idle_lastmsg), true); const std::string idletime = Time::ToString(loper->idle_lastmsg); extra += FMT::format("{} idle for {} [since {}]", extra.empty() ? ':' : ',', idleperiod, idletime); |
