From 3d17513852c8f691672bf14fa647b1a795dfc7ad Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 28 Apr 2020 12:03:00 +0300 Subject: [PATCH] Add separate remove_sponsored_dialog. GitOrigin-RevId: 23b569a314f0dc577e2f65e1a47d51a9434174aa --- td/telegram/MessagesManager.cpp | 9 +++++---- td/telegram/MessagesManager.h | 2 ++ td/telegram/net/ConnectionCreator.cpp | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index c8ce5a94..3c875655 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -30446,13 +30446,14 @@ void MessagesManager::get_payment_receipt(FullMessageId full_message_id, ::td::get_payment_receipt(m->message_id.get_server_message_id(), std::move(promise)); } +void MessagesManager::remove_sponsored_dialog() { + set_sponsored_dialog_id(DialogId()); +} + void MessagesManager::on_get_sponsored_dialog_id(tl_object_ptr peer, vector> users, vector> chats) { - if (peer == nullptr) { - set_sponsored_dialog_id(DialogId()); - return; - } + CHECK(peer != nullptr); td_->contacts_manager_->on_get_users(std::move(users), "on_get_sponsored_dialog_id"); td_->contacts_manager_->on_get_chats(std::move(chats), "on_get_sponsored_dialog_id"); diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 12cac975..6437faec 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -762,6 +762,8 @@ class MessagesManager : public Actor { void on_get_dialog_query_finished(DialogId dialog_id, Status &&status); + void remove_sponsored_dialog(); + void on_get_sponsored_dialog_id(tl_object_ptr peer, vector> users, vector> chats); diff --git a/td/telegram/net/ConnectionCreator.cpp b/td/telegram/net/ConnectionCreator.cpp index a10afa58..f09776ef 100644 --- a/td/telegram/net/ConnectionCreator.cpp +++ b/td/telegram/net/ConnectionCreator.cpp @@ -1306,8 +1306,7 @@ void ConnectionCreator::on_get_proxy_info(telegram_api::object_ptr(proxy_data_ptr); expires = proxy->expires_; - send_closure(G()->messages_manager(), &MessagesManager::on_get_sponsored_dialog_id, nullptr, - vector>(), vector>()); + send_closure(G()->messages_manager(), &MessagesManager::remove_sponsored_dialog); break; } case telegram_api::help_proxyDataPromo::ID: {