diff options
| author | levlam <levlam@telegram.org> | 2024-10-04 17:54:45 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2024-10-04 17:54:45 +0300 |
| commit | e7fb167b407a8b73b99a5cff75212f26aa79f379 (patch) | |
| tree | 527bbb95dd86fb428613c7493985c925ee606ab4 /td/telegram/Payments.cpp | |
| parent | cf1d1dbb91ec9d153317ac26e93e181934b3f3b3 (diff) | |
Add telegramPaymentPurposePremiumGiftCodes.text.
Diffstat (limited to 'td/telegram/Payments.cpp')
| -rw-r--r-- | td/telegram/Payments.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/td/telegram/Payments.cpp b/td/telegram/Payments.cpp index da86ae2c4..548d9251d 100644 --- a/td/telegram/Payments.cpp +++ b/td/telegram/Payments.cpp @@ -16,6 +16,7 @@ #include "td/telegram/LinkManager.h" #include "td/telegram/MessageEntity.h" #include "td/telegram/MessageId.h" +#include "td/telegram/MessageQuote.h" #include "td/telegram/MessagesManager.h" #include "td/telegram/misc.h" #include "td/telegram/PasswordManager.h" @@ -99,14 +100,24 @@ Result<InputInvoiceInfo> get_input_invoice_info(Td *td, td_api::object_ptr<td_ap } DialogId boosted_dialog_id(p->boosted_chat_id_); TRY_RESULT(boost_input_peer, get_boost_input_peer(td, boosted_dialog_id)); + TRY_RESULT(message, get_formatted_text(td, td->dialog_manager_->get_my_dialog_id(), std::move(p->text_), + false, true, true, false)); + MessageQuote::remove_unallowed_quote_entities(message); + int32 flags = 0; if (boost_input_peer != nullptr) { flags |= telegram_api::inputStorePaymentPremiumGiftCode::BOOST_PEER_MASK; } + telegram_api::object_ptr<telegram_api::textWithEntities> text; + if (!message.text.empty()) { + flags |= telegram_api::inputStorePaymentPremiumGiftCode::MESSAGE_MASK; + text = get_input_text_with_entities(td->user_manager_.get(), message, + "telegramPaymentPurposePremiumGiftCodes"); + } auto option = telegram_api::make_object<telegram_api::premiumGiftCodeOption>( 0, static_cast<int32>(input_users.size()), p->month_count_, string(), 0, p->currency_, p->amount_); auto purpose = telegram_api::make_object<telegram_api::inputStorePaymentPremiumGiftCode>( - flags, std::move(input_users), std::move(boost_input_peer), p->currency_, p->amount_, nullptr); + flags, std::move(input_users), std::move(boost_input_peer), p->currency_, p->amount_, std::move(text)); result.dialog_id_ = boosted_dialog_id; result.input_invoice_ = telegram_api::make_object<telegram_api::inputInvoicePremiumGiftCode>( |
