From 93ae5e71f7547b97d793f729f2fd720d10aca27b Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 21 Oct 2021 22:39:43 +0300 Subject: [PATCH] Guarded timers for online processing in touchbar's PinnedDialogButton. --- .../platform/mac/touchbar/items/mac_pinned_chats_item.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm index 3e57fa79b8..6b9d7a5dc5 100644 --- a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm +++ b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm @@ -575,7 +575,8 @@ TimeId CalculateOnlineTill(not_null peer) { if (pin->onlineTill) { const auto time = pin->onlineTill - base::unixtime::now(); if (time > 0) { - onlineTimer->callOnce(time * crl::time(1000)); + onlineTimer->callOnce(std::min(86400, time) + * crl::time(1000)); } } };