diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 53517966..45f41e3d 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -2387,7 +2387,7 @@ updateChatReplyMarkup chat_id:int53 reply_markup_message_id:int53 = Update; //@description A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update shouldn't be applied @chat_id Chat identifier @draft_message The new draft message; may be null @order New value of the chat order updateChatDraftMessage chat_id:int53 draft_message:draftMessage order:int64 = Update; -//@description The number of online group members has changed. This update is sent only for currently open chats. There is no guarantee that it will be sent just after the count has changed @chat_id Identifier of the chat @online_member_count New number of online members in the chat, or 0 if unknown +//@description The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed @chat_id Identifier of the chat @online_member_count New number of online members in the chat, or 0 if unknown updateChatOnlineMemberCount chat_id:int53 online_member_count:int32 = Update; //@description A notification was changed @notification_group_id Unique notification group identifier @notification Changed notification diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 8c6c2b51..ab24ccfe 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -8599,6 +8599,7 @@ void MessagesManager::on_update_dialog_online_member_count_timeout(DialogId dial Dialog *d = get_dialog(dialog_id); CHECK(d != nullptr); if (!d->is_opened) { + send_update_chat_online_member_count(dialog_id, 0); return; } @@ -13032,7 +13033,8 @@ void MessagesManager::close_dialog(Dialog *d) { auto &info = online_count_it->second; info.is_update_sent = false; } - update_dialog_online_member_count_timeout_.cancel_timeout(d->dialog_id.get()); + update_dialog_online_member_count_timeout_.set_timeout_in(d->dialog_id.get(), + ONLINE_MEMBER_COUNT_CACHE_EXPIRE_TIME); } }