From 2eab9fc897742acb666ee68ba7e6895658db29c0 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 12 Aug 2024 21:25:29 +0300 Subject: [PATCH] Add td_api::starTransactionPartnerBusiness. --- td/generate/scheme/td_api.tl | 7 +++++-- td/telegram/StarManager.cpp | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 8d0d8307d..76f9d2db5 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -890,7 +890,7 @@ starTransactionDirectionOutgoing = StarTransactionDirection; //@class BotTransactionPurpose @description Describes purpose of a transaction with a bot -//@description Paid media were bought @media The bought media if they are still accessible +//@description Paid media were bought @media The bought media if the trancastion wasn't refunded botTransactionPurposePaidMedia media:vector = BotTransactionPurpose; //@description User bought a product from the bot @@ -903,7 +903,7 @@ botTransactionPurposeInvoicePayment product_info:productInfo invoice_payload:byt //@description Paid media were bought //@message_id Identifier of the corresponding message with paid media; can be an identifier of a deleted message -//@media The bought media if they are still accessible +//@media The bought media if the trancastion wasn't refunded channelTransactionPurposePaidMedia message_id:int53 media:vector = ChannelTransactionPurpose; //@description User joined the channel and subscribed to regular payments in Telegram Stars @@ -935,6 +935,9 @@ starTransactionPartnerTelegramAds = StarTransactionPartner; //@description The transaction is a transaction with a bot @user_id Identifier of the bot @purpose Purpose of the transaction starTransactionPartnerBot user_id:int53 purpose:BotTransactionPurpose = StarTransactionPartner; +//@description The transaction is a transaction with a business account @user_id Identifier of the business account user @media The bought media if the trancastion wasn't refunded +starTransactionPartnerBusiness user_id:int53 media:vector = StarTransactionPartner; + //@description The transaction is a transaction with a channel chat @chat_id Identifier of the chat @purpose Purpose of the transaction starTransactionPartnerChannel chat_id:int53 purpose:ChannelTransactionPurpose = StarTransactionPartner; diff --git a/td/telegram/StarManager.cpp b/td/telegram/StarManager.cpp index 6be62f5aa..adb22ca63 100644 --- a/td/telegram/StarManager.cpp +++ b/td/telegram/StarManager.cpp @@ -279,6 +279,11 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { td_->stickers_manager_->get_premium_gift_sticker_object( StarManager::get_months_by_star_count(star_count))); } + if (!transaction->extended_media_.empty()) { // TODO + return td_api::make_object( + td_->user_manager_->get_user_id_object(user_id, "starTransactionPartnerBusiness"), + get_paid_media_objects(DialogId(user_id))); + } LOG(ERROR) << "Receive Telegram Star transaction with " << user_id; return td_api::make_object(); }