diff --git a/Telegram/SourceFiles/api/api_send_progress.cpp b/Telegram/SourceFiles/api/api_send_progress.cpp index c21a1a516..c3436f7ab 100644 --- a/Telegram/SourceFiles/api/api_send_progress.cpp +++ b/Telegram/SourceFiles/api/api_send_progress.cpp @@ -19,7 +19,8 @@ namespace Api { namespace { constexpr auto kCancelTypingActionTimeout = crl::time(5000); -constexpr auto kSetMyActionForMs = 10 * crl::time(1000); +constexpr auto kSendMySpeakingInterval = 3 * crl::time(1000); +constexpr auto kSendMyTypingInterval = 5 * crl::time(1000); constexpr auto kSendTypingsToOfflineFor = TimeId(30); } // namespace @@ -82,12 +83,15 @@ bool SendProgressManager::updated(const Key &key, bool doing) { const auto now = crl::now(); const auto i = _updated.find(key); if (doing) { + const auto sendEach = (key.type == SendProgressType::Speaking) + ? kSendMySpeakingInterval + : kSendMyTypingInterval; if (i == end(_updated)) { - _updated.emplace(key, now + kSetMyActionForMs); - } else if (i->second > now + (kSetMyActionForMs / 2)) { + _updated.emplace(key, now + 2 * sendEach); + } else if (i->second > now + sendEach) { return false; } else { - i->second = now + kSetMyActionForMs; + i->second = now + 2 * sendEach; } } else { if (i == end(_updated)) {