aboutsummaryrefslogtreecommitdiffstats
path: root/modules/joinflood.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/joinflood.cpp
parentConvert TLS::IOHook::Status to an enum class. (diff)
Use saturating adds/subtracts when handling timestamps.
Diffstat (limited to 'modules/joinflood.cpp')
-rw-r--r--modules/joinflood.cpp8
1 files changed, 4 insertions, 4 deletions
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<time_t>(ignoreuntil, ServerInstance->Time() + splitwait);
+ ignoreuntil = std::max<time_t>(ignoreuntil, Time::In(splitwait));
}
ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, PrefixMode::Set& privs, const std::string& keygiven, bool override) override