From 6a5989eb8bdd9db05c9f5e64965ffe768713ef48 Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 24 Sep 2022 22:42:47 +0300 Subject: [PATCH] Add InputInvoice::update_from. --- td/telegram/InputInvoice.cpp | 4 ++++ td/telegram/InputInvoice.h | 2 ++ td/telegram/MessageContent.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/td/telegram/InputInvoice.cpp b/td/telegram/InputInvoice.cpp index 0848f62d1..c1766e1db 100644 --- a/td/telegram/InputInvoice.cpp +++ b/td/telegram/InputInvoice.cpp @@ -379,6 +379,10 @@ FileId InputInvoice::get_thumbnail_file_id(const Td *td) const { return extended_media_.get_thumbnail_file_id(td); } +void InputInvoice::update_from(const InputInvoice &old_input_invoice) { + extended_media_.update_from(old_input_invoice.extended_media_); +} + bool InputInvoice::update_extended_media(telegram_api::object_ptr extended_media, DialogId owner_dialog_id, Td *td) { return extended_media_.update_to(td, std::move(extended_media), owner_dialog_id); diff --git a/td/telegram/InputInvoice.h b/td/telegram/InputInvoice.h index 607d74306..2efa70f46 100644 --- a/td/telegram/InputInvoice.h +++ b/td/telegram/InputInvoice.h @@ -95,6 +95,8 @@ struct InputInvoice { FileId get_thumbnail_file_id(const Td *td) const; + void update_from(const InputInvoice &old_input_invoice); + bool update_extended_media(telegram_api::object_ptr extended_media, DialogId owner_dialog_id, Td *td); diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index fec66c5de..c966717d8 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -3222,7 +3222,7 @@ void merge_message_contents(Td *td, const MessageContent *old_content, MessageCo case MessageContentType::Invoice: { const auto *old_ = static_cast(old_content); auto *new_ = static_cast(new_content); - new_->input_invoice.extended_media_.update_from(old_->input_invoice.extended_media_); + new_->input_invoice.update_from(old_->input_invoice); if (old_->input_invoice != new_->input_invoice) { need_update = true; }