diff options
| author | 2026-07-10 11:15:52 +0100 | |
|---|---|---|
| committer | 2026-07-10 11:58:06 +0100 | |
| commit | 5f9c2b3c97ed1eeb19270fd3582b71ca8e1ca1ac (patch) | |
| tree | a6d3d38e04f30b0906141f49d4e0fd643be1d0d9 /modules/joinflood.cpp | |
| parent | Convert 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.cpp | 8 |
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 |
