From 5f9c2b3c97ed1eeb19270fd3582b71ca8e1ca1ac Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 10 Jul 2026 11:15:52 +0100 Subject: Use saturating adds/subtracts when handling timestamps. --- modules/joinflood.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/joinflood.cpp') diff --git a/modules/joinflood.cpp b/modules/joinflood.cpp index f171b2518..75f0d8ca9 100644 --- a/modules/joinflood.cpp +++ b/modules/joinflood.cpp @@ -48,7 +48,7 @@ public: : secs(b) , joins(c) { - reset = ServerInstance->Time() + secs; + reset = Time::In(secs); } void addjoin() @@ -56,7 +56,7 @@ public: if (ServerInstance->Time() > reset) { counter = 1; - reset = ServerInstance->Time() + secs; + reset = Time::In(secs); } else counter++; @@ -82,7 +82,7 @@ public: void lock() { - unlocktime = ServerInstance->Time() + duration; + unlocktime = Time::In(duration); } bool operator==(const joinfloodsettings& other) const @@ -166,7 +166,7 @@ public: void OnServerSplit(const Server& server, bool error) override { if (splitwait) - ignoreuntil = std::max(ignoreuntil, ServerInstance->Time() + splitwait); + ignoreuntil = std::max(ignoreuntil, Time::In(splitwait)); } ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, PrefixMode::Set& privs, const std::string& keygiven, bool override) override -- cgit v1.3.1-10-gc9f91