diff options
| author | 2026-07-10 11:15:52 +0100 | |
|---|---|---|
| committer | 2026-07-10 11:58:06 +0100 | |
| commit | 5f9c2b3c97ed1eeb19270fd3582b71ca8e1ca1ac (patch) | |
| tree | a6d3d38e04f30b0906141f49d4e0fd643be1d0d9 /src/usermanager.cpp | |
| parent | Convert TLS::IOHook::Status to an enum class. (diff) | |
Use saturating adds/subtracts when handling timestamps.
Diffstat (limited to 'src/usermanager.cpp')
| -rw-r--r-- | src/usermanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 861085636..dedb4add0 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -65,14 +65,14 @@ namespace // This user didn't answer the last ping, remove them. if (!user->lastping) { - time_t secs = ServerInstance->Time() - (user->nextping - user->GetClass()->pingtime); + const auto secs = Time::Ago(user->nextping - user->GetClass()->pingtime); const std::string message = FMT::format("Ping timeout: {}", Duration::ToLongString(secs)); ServerInstance->Users.QuitUser(user, message); return; } user->lastping = 0; - user->nextping = ServerInstance->Time() + user->GetClass()->pingtime; + user->nextping = Time::In(user->GetClass()->pingtime); // If the user has an I/O handler that can handle pinging use that // instead. Otherwise, send a ping using an IRC message. |
