From 0e58301dc8fabef9e9fbd5eb35baab14524b71b8 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 1 Apr 2023 23:04:30 +0300 Subject: [PATCH] fix: timeout mutes always being applied for 28d They were still being removed by the bot after the real mute time, but the native timeout was always set to 28d. --- backend/src/plugins/Mutes/functions/getTimeoutExpiryTime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Mutes/functions/getTimeoutExpiryTime.ts b/backend/src/plugins/Mutes/functions/getTimeoutExpiryTime.ts index 7309d53e..28f760b9 100644 --- a/backend/src/plugins/Mutes/functions/getTimeoutExpiryTime.ts +++ b/backend/src/plugins/Mutes/functions/getTimeoutExpiryTime.ts @@ -7,7 +7,7 @@ import { MAX_TIMEOUT_DURATION } from "../../../data/Mutes"; * @return - Timeout expiry timestamp */ export function getTimeoutExpiryTime(muteExpiresAt: number | null | undefined): number { - if (muteExpiresAt && muteExpiresAt <= MAX_TIMEOUT_DURATION) { + if (muteExpiresAt && muteExpiresAt - Date.now() <= MAX_TIMEOUT_DURATION) { return muteExpiresAt; } return Date.now() + MAX_TIMEOUT_DURATION;