diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp index 7ae5b6cea..c4e083659 100644 --- a/td/telegram/WebPagesManager.cpp +++ b/td/telegram/WebPagesManager.cpp @@ -62,15 +62,15 @@ namespace td { class GetWebPagePreviewQuery final : public Td::ResultHandler { Promise> promise_; - string url_; + string first_url_; public: explicit GetWebPagePreviewQuery(Promise> &&promise) : promise_(std::move(promise)) { } - void send(const string &text, vector> &&entities, string url) { - url_ = std::move(url); + void send(const string &text, vector> &&entities, string first_url) { + first_url_ = std::move(first_url); int32 flags = 0; if (!entities.empty()) { @@ -89,7 +89,7 @@ class GetWebPagePreviewQuery final : public Td::ResultHandler { auto ptr = result_ptr.move_as_ok(); LOG(INFO) << "Receive result for GetWebPagePreviewQuery: " << to_string(ptr); - td_->web_pages_manager_->on_get_web_page_preview(url_, std::move(ptr), std::move(promise_)); + td_->web_pages_manager_->on_get_web_page_preview(first_url_, std::move(ptr), std::move(promise_)); } void on_error(Status status) final { @@ -828,14 +828,14 @@ void WebPagesManager::unregister_web_page(WebPageId web_page_id, MessageFullId m } } -void WebPagesManager::on_get_web_page_preview(const string &url, +void WebPagesManager::on_get_web_page_preview(const string &first_url, tl_object_ptr &&message_media_ptr, Promise> &&promise) { CHECK(message_media_ptr != nullptr); int32 constructor_id = message_media_ptr->get_id(); if (constructor_id != telegram_api::messageMediaWebPage::ID) { if (constructor_id == telegram_api::messageMediaEmpty::ID) { - on_get_web_page_preview_success(url, WebPageId(), std::move(promise)); + on_get_web_page_preview_success(first_url, WebPageId(), std::move(promise)); return; } @@ -848,19 +848,19 @@ void WebPagesManager::on_get_web_page_preview(const string &url, auto web_page_id = on_get_web_page(std::move(message_media_web_page->webpage_), DialogId()); if (web_page_id.is_valid() && !have_web_page(web_page_id)) { - pending_get_web_pages_[web_page_id].emplace_back(url, std::move(promise)); + pending_get_web_pages_[web_page_id].emplace_back(first_url, std::move(promise)); return; } - on_get_web_page_preview_success(url, web_page_id, std::move(promise)); + on_get_web_page_preview_success(first_url, web_page_id, std::move(promise)); } -void WebPagesManager::on_get_web_page_preview_success(const string &url, WebPageId web_page_id, +void WebPagesManager::on_get_web_page_preview_success(const string &first_url, WebPageId web_page_id, Promise> &&promise) { CHECK(web_page_id == WebPageId() || have_web_page(web_page_id)); - if (web_page_id.is_valid() && !url.empty()) { - on_get_web_page_by_url(url, web_page_id, true); + if (web_page_id.is_valid() && !first_url.empty()) { + on_get_web_page_by_url(first_url, web_page_id, true); } promise.set_value(get_web_page_object(web_page_id, false, false)); @@ -871,21 +871,21 @@ void WebPagesManager::get_web_page_preview(td_api::object_ptrcreate_handler(std::move(promise)) ->send(formatted_text.text, get_input_message_entities(td_->contacts_manager_.get(), formatted_text.entities, "get_web_page_preview"), - std::move(url)); + std::move(first_url)); } void WebPagesManager::get_web_page_instant_view(const string &url, bool force_full, Promise &&promise) { diff --git a/td/telegram/WebPagesManager.h b/td/telegram/WebPagesManager.h index 2d1c7feb3..7517eab5b 100644 --- a/td/telegram/WebPagesManager.h +++ b/td/telegram/WebPagesManager.h @@ -80,7 +80,7 @@ class WebPagesManager final : public Actor { void reload_web_page_by_url(const string &url, Promise &&promise); - void on_get_web_page_preview(const string &url, tl_object_ptr &&message_media_ptr, + void on_get_web_page_preview(const string &first_url, tl_object_ptr &&message_media_ptr, Promise> &&promise); SecretInputMedia get_secret_input_media(WebPageId web_page_id) const; @@ -129,7 +129,7 @@ class WebPagesManager final : public Actor { void on_pending_web_page_timeout(WebPageId web_page_id); - void on_get_web_page_preview_success(const string &url, WebPageId web_page_id, + void on_get_web_page_preview_success(const string &first_url, WebPageId web_page_id, Promise> &&promise); void on_get_web_page_instant_view(WebPage *web_page, tl_object_ptr &&page, int32 hash,