From ab89543894a177a3d7b9a874a28f5941153e9692 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 20 Dec 2021 20:45:35 +0300 Subject: [PATCH 1/3] Don't reload ChannelFull in get_channel_participants. --- td/telegram/ContactsManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 34105cfd5..685496f42 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -15213,7 +15213,7 @@ void ContactsManager::get_channel_participants(ChannelId channel_id, return promise.set_error(Status::Error(400, "Parameter offset must be non-negative")); } - auto channel_full = get_channel_full_force(channel_id, false, "get_channel_participants"); + auto channel_full = get_channel_full_force(channel_id, true, "get_channel_participants"); if (channel_full != nullptr && !channel_full->is_expired() && !channel_full->can_get_participants) { return promise.set_error(Status::Error(400, "Member list is inaccessible")); } From 40c74a5d0a1041a593d1db7877074741bafe27c4 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 20 Dec 2021 20:55:47 +0300 Subject: [PATCH 2/3] Suppress expected warning. --- 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 3c85b6e1b..c9631ff05 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -30110,7 +30110,9 @@ void MessagesManager::on_send_message_fail(int64 random_id, Status error) { << *m->reply_markup; } } - LOG_IF(WARNING, error_code != 403) << "Fail to send " << full_message_id << " with the error " << error; + if (error_code != 403 && !(error_code == 500 && G()->close_flag())) { + LOG(WARNING) << "Fail to send " << full_message_id << " with the error " << error; + } if (error_code <= 0) { error_code = 500; } From 7334b262fbd87710ed740bf88c6e35d292bf324c Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 20 Dec 2021 21:11:02 +0300 Subject: [PATCH 3/3] Remove unneeded logging on instance closing. --- td/telegram/Td.cpp | 7 +++---- td/telegram/cli.cpp | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index df59dbedd..7066b47c7 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -3296,7 +3296,7 @@ void Td::dec_actor_refcnt() { create_reference(); close_flag_ = 3; } else if (close_flag_ == 3) { - LOG(WARNING) << "ON_ACTORS_CLOSED"; + LOG(INFO) << "All actors were closed"; Timer timer; animations_manager_.reset(); LOG(DEBUG) << "AnimationsManager was cleared" << timer; @@ -3371,7 +3371,6 @@ void Td::dec_actor_refcnt() { } void Td::on_closed() { - LOG(WARNING) << "ON_CLOSED"; close_flag_ = 5; send_update( td_api::make_object(td_api::make_object())); @@ -3381,7 +3380,7 @@ void Td::on_closed() { void Td::dec_stop_cnt() { stop_cnt_--; if (stop_cnt_ == 0) { - LOG(WARNING) << "Stop Td"; + LOG(INFO) << "Stop Td"; set_context(std::move(old_context_)); stop(); } @@ -3395,7 +3394,7 @@ void Td::dec_request_actor_refcnt() { request_actor_refcnt_--; LOG(DEBUG) << "Decrease request actor count to " << request_actor_refcnt_; if (request_actor_refcnt_ == 0) { - LOG(WARNING) << "Have no request actors"; + LOG(INFO) << "Have no request actors"; clear(); dec_actor_refcnt(); // remove guard } diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index a2994354c..a2a5a89bc 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -4542,7 +4542,6 @@ class CliClient final : public Actor { rl_callback_handler_remove(); #endif Scheduler::instance()->finish(); - LOG(WARNING) << "STOP"; stop(); } }