From 9de4c425556ce8647f4610d77ff327bc96ea0a62 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 23 Oct 2020 18:25:55 +0300 Subject: [PATCH] Keep sending typings up to 30s after offline. --- Telegram/SourceFiles/api/api_send_progress.cpp | 4 +++- cmake | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/api/api_send_progress.cpp b/Telegram/SourceFiles/api/api_send_progress.cpp index 1335b6fb1d..d4cfcba390 100644 --- a/Telegram/SourceFiles/api/api_send_progress.cpp +++ b/Telegram/SourceFiles/api/api_send_progress.cpp @@ -20,6 +20,7 @@ namespace { constexpr auto kCancelTypingActionTimeout = crl::time(5000); constexpr auto kSetMyActionForMs = 10 * crl::time(1000); +constexpr auto kSendTypingsToOfflineFor = TimeId(30); } // namespace @@ -150,7 +151,8 @@ bool SendProgressManager::skipRequest(const Key &key) const { } else if (user->isBot() && !user->isSupport()) { return true; } - return !Data::OnlineTextActive(user->onlineTill, base::unixtime::now()); + const auto recently = base::unixtime::now() - kSendTypingsToOfflineFor; + return !Data::OnlineTextActive(user->onlineTill, recently); } void SendProgressManager::done( diff --git a/cmake b/cmake index b485d43a45..cfc6051fb6 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit b485d43a45eec75b8cbc0ab966ab3c06b5e8bac8 +Subproject commit cfc6051fb65da4c67ccbc2a1d9e753758f995fe3