Move get_product_description_object to InputInvoice.h.

This commit is contained in:
levlam 2022-09-22 19:37:02 +03:00
parent cb01c3022c
commit fa5dbe4751
5 changed files with 10 additions and 11 deletions

View File

@ -8,7 +8,6 @@
#include "td/telegram/files/FileManager.h" #include "td/telegram/files/FileManager.h"
#include "td/telegram/misc.h" #include "td/telegram/misc.h"
#include "td/telegram/Payments.h"
#include "td/telegram/PhotoSize.h" #include "td/telegram/PhotoSize.h"
#include "td/telegram/Td.h" #include "td/telegram/Td.h"
@ -395,4 +394,11 @@ FileId get_input_invoice_thumbnail_file_id(const Td *td, const InputInvoice &inp
return input_invoice.extended_media.get_thumbnail_file_id(td); return input_invoice.extended_media.get_thumbnail_file_id(td);
} }
tl_object_ptr<td_api::formattedText> get_product_description_object(const string &description) {
FormattedText result;
result.text = description;
result.entities = find_entities(result.text, true, true);
return get_formatted_text_object(result, true, 0);
}
} // namespace td } // namespace td

View File

@ -99,4 +99,6 @@ FileId get_input_invoice_any_file_id(const InputInvoice &input_invoice);
FileId get_input_invoice_thumbnail_file_id(const Td *td, const InputInvoice &input_invoice); FileId get_input_invoice_thumbnail_file_id(const Td *td, const InputInvoice &input_invoice);
tl_object_ptr<td_api::formattedText> get_product_description_object(const string &description);
} // namespace td } // namespace td

View File

@ -6,7 +6,7 @@
// //
#pragma once #pragma once
#include "td/telegram/Payments.h" #include "td/telegram/OrderInfo.h"
#include "td/utils/tl_helpers.h" #include "td/utils/tl_helpers.h"

View File

@ -33,13 +33,6 @@
namespace td { namespace td {
tl_object_ptr<td_api::formattedText> get_product_description_object(const string &description) {
FormattedText result;
result.text = description;
result.entities = find_entities(result.text, true, true);
return get_formatted_text_object(result, true, 0);
}
namespace { namespace {
struct InputInvoiceInfo { struct InputInvoiceInfo {

View File

@ -33,8 +33,6 @@ bool operator!=(const ShippingOption &lhs, const ShippingOption &rhs);
StringBuilder &operator<<(StringBuilder &string_builder, const ShippingOption &shipping_option); StringBuilder &operator<<(StringBuilder &string_builder, const ShippingOption &shipping_option);
tl_object_ptr<td_api::formattedText> get_product_description_object(const string &description);
void answer_shipping_query(Td *td, int64 shipping_query_id, void answer_shipping_query(Td *td, int64 shipping_query_id,
vector<tl_object_ptr<td_api::shippingOption>> &&shipping_options, vector<tl_object_ptr<td_api::shippingOption>> &&shipping_options,
const string &error_message, Promise<Unit> &&promise); const string &error_message, Promise<Unit> &&promise);