From ca460dab6da8abf4aabda3dfb9c82796b3772a9b Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 4 Nov 2022 17:18:46 +0400 Subject: [PATCH] Fix mute value casting. --- .../SourceFiles/data/notify/data_peer_notify_settings.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/data/notify/data_peer_notify_settings.cpp b/Telegram/SourceFiles/data/notify/data_peer_notify_settings.cpp index e1318e574..6d5735624 100644 --- a/Telegram/SourceFiles/data/notify/data_peer_notify_settings.cpp +++ b/Telegram/SourceFiles/data/notify/data_peer_notify_settings.cpp @@ -54,10 +54,12 @@ namespace { } // namespace int MuteValue::until() const { + constexpr auto kMax = std::numeric_limits::max(); + return forever - ? std::numeric_limits::max() + ? kMax : (period > 0) - ? (base::unixtime::now() + period) + ? int(std::min(int64(base::unixtime::now()) + period, int64(kMax))) : unmute ? 0 : -1;