Add separate remove_sponsored_dialog.

GitOrigin-RevId: 23b569a314f0dc577e2f65e1a47d51a9434174aa
This commit is contained in:
levlam 2020-04-28 12:03:00 +03:00
parent 2c728d17b5
commit 3d17513852
3 changed files with 8 additions and 6 deletions

View File

@ -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<telegram_api::Peer> peer,
vector<tl_object_ptr<telegram_api::User>> users,
vector<tl_object_ptr<telegram_api::Chat>> 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");

View File

@ -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<telegram_api::Peer> peer,
vector<tl_object_ptr<telegram_api::User>> users,
vector<tl_object_ptr<telegram_api::Chat>> chats);

View File

@ -1306,8 +1306,7 @@ void ConnectionCreator::on_get_proxy_info(telegram_api::object_ptr<telegram_api:
case telegram_api::help_proxyDataEmpty::ID: {
auto proxy = telegram_api::move_object_as<telegram_api::help_proxyDataEmpty>(proxy_data_ptr);
expires = proxy->expires_;
send_closure(G()->messages_manager(), &MessagesManager::on_get_sponsored_dialog_id, nullptr,
vector<tl_object_ptr<telegram_api::User>>(), vector<tl_object_ptr<telegram_api::Chat>>());
send_closure(G()->messages_manager(), &MessagesManager::remove_sponsored_dialog);
break;
}
case telegram_api::help_proxyDataPromo::ID: {