From 5171d793d035e4dd238238e8e7ff7bc96dbd090c Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 30 Jul 2021 17:50:28 +0300 Subject: [PATCH 1/3] Don't set have_next to true if all next messages were deleted. --- td/telegram/MessagesManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 244ef1453..a7f315a3d 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -9386,7 +9386,9 @@ void MessagesManager::on_get_history(DialogId dialog_id, MessageId from_message_ } } - have_next = true; + if (!message_ids.empty()) { + have_next = true; + } } } From e1b756a4375017da42d3d53156d80f5c7822abeb Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 30 Jul 2021 19:18:24 +0300 Subject: [PATCH 2/3] Document new allowed month TTL period. --- td/generate/scheme/td_api.tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index aacaa1919..1dec08a74 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -4506,7 +4506,7 @@ setChatPhoto chat_id:int53 photo:InputChatPhoto = Ok; //@description Changes the message TTL setting (sets a new self-destruct timer) in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels //-Message TTL setting of a chat with the current user (Saved Messages) and the chat 777000 (Telegram) can't be changed -//@chat_id Chat identifier @ttl New TTL value, in seconds; must be one of 0, 86400, 604800 unless chat is secret +//@chat_id Chat identifier @ttl New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret setChatMessageTtlSetting chat_id:int53 ttl:int32 = Ok; //@description Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right From a4bd165061ce0df9c29581c5cfdee1fb81871044 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 30 Jul 2021 21:05:18 +0300 Subject: [PATCH 3/3] Increase MAX_UNFILLED_GAP_TIME to 0.7. 0.4 timeout is too low and causes too much unneeded getDifference calls. --- td/telegram/UpdatesManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index f17446c85..d644048de 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -165,7 +165,7 @@ class GetDifferenceQuery final : public Td::ResultHandler { } }; -const double UpdatesManager::MAX_UNFILLED_GAP_TIME = 0.4; +const double UpdatesManager::MAX_UNFILLED_GAP_TIME = 0.7; UpdatesManager::UpdatesManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) { pts_manager_.init(-1);