diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index bab221903..3496a7acc 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -850,28 +850,28 @@ starTransactionDirectionIncoming = StarTransactionDirection; starTransactionDirectionOutgoing = StarTransactionDirection; -//@class StarTransactionSource @description Describes source or recipient of a transaction with Telegram stars +//@class StarTransactionPartner @description Describes source or recipient of a transaction with Telegram stars //@description The transaction is a transaction with Telegram through a bot -starTransactionSourceTelegram = StarTransactionSource; +starTransactionPartnerTelegram = StarTransactionPartner; //@description The transaction is a transaction with App Store -starTransactionSourceAppStore = StarTransactionSource; +starTransactionPartnerAppStore = StarTransactionPartner; //@description The transaction is a transaction with Google Play -starTransactionSourceGooglePlay = StarTransactionSource; +starTransactionPartnerGooglePlay = StarTransactionPartner; //@description The transaction is a transaction with Fragment @withdrawal_state State of the withdrawal; may be null for refunds from Fragment -starTransactionSourceFragment withdrawal_state:RevenueWithdrawalState = StarTransactionSource; +starTransactionPartnerFragment withdrawal_state:RevenueWithdrawalState = StarTransactionPartner; //@description The transaction is a transaction with another user @user_id Identifier of the user @product_info Information about the bought product; may be null if none -starTransactionSourceUser user_id:int53 product_info:productInfo = StarTransactionSource; +starTransactionPartnerUser user_id:int53 product_info:productInfo = StarTransactionPartner; //@description The transaction is a transaction with a channel chat @chat_id Identifier of the chat -starTransactionSourceChannel chat_id:int53 = StarTransactionSource; +starTransactionPartnerChannel chat_id:int53 = StarTransactionPartner; -//@description The transaction is a transaction with unknown source -starTransactionSourceUnsupported = StarTransactionSource; +//@description The transaction is a transaction with unknown partner +starTransactionPartnerUnsupported = StarTransactionPartner; //@description Represents a transaction changing the amount of owned Telegram stars @@ -879,8 +879,8 @@ starTransactionSourceUnsupported = StarTransactionSource; //@star_count The amount of added owned Telegram stars; negative for outgoing transactions //@is_refund True, if the transaction is a refund of a previous transaction //@date Point in time (Unix timestamp) when the transaction was completed -//@source Source of the transaction, or its recipient for outgoing transactions -starTransaction id:string star_count:int53 is_refund:Bool date:int32 source:StarTransactionSource = StarTransaction; +//@partner Source of the incoming transaction, or its recipient for outgoing transactions +starTransaction id:string star_count:int53 is_refund:Bool date:int32 partner:StarTransactionPartner = StarTransaction; //@description Represents a list of Telegram star transactions //@star_count The amount of owned Telegram stars diff --git a/td/telegram/StarManager.cpp b/td/telegram/StarManager.cpp index 008af126b..934d90fd4 100644 --- a/td/telegram/StarManager.cpp +++ b/td/telegram/StarManager.cpp @@ -115,16 +115,16 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { auto photo = get_web_document_photo(td_->file_manager_.get(), std::move(transaction->photo_), DialogId()); product_info = get_product_info_object(td_, transaction->title_, transaction->description_, photo); } - auto source = [&]() -> td_api::object_ptr { + auto partner = [&]() -> td_api::object_ptr { switch (transaction->peer_->get_id()) { case telegram_api::starsTransactionPeerUnsupported::ID: - return td_api::make_object(); + return td_api::make_object(); case telegram_api::starsTransactionPeerPremiumBot::ID: - return td_api::make_object(); + return td_api::make_object(); case telegram_api::starsTransactionPeerAppStore::ID: - return td_api::make_object(); + return td_api::make_object(); case telegram_api::starsTransactionPeerPlayMarket::ID: - return td_api::make_object(); + return td_api::make_object(); case telegram_api::starsTransactionPeerFragment::ID: { auto state = [&]() -> td_api::object_ptr { if (transaction->transaction_date_ > 0) { @@ -142,21 +142,21 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { } return nullptr; }(); - return td_api::make_object(std::move(state)); + return td_api::make_object(std::move(state)); } case telegram_api::starsTransactionPeer::ID: { DialogId dialog_id( static_cast(transaction->peer_.get())->peer_); if (dialog_id.get_type() == DialogType::User) { - return td_api::make_object( - td_->user_manager_->get_user_id_object(dialog_id.get_user_id(), "starTransactionSourceUser"), + return td_api::make_object( + td_->user_manager_->get_user_id_object(dialog_id.get_user_id(), "starTransactionPartnerUser"), std::move(product_info)); } if (td_->dialog_manager_->is_broadcast_channel(dialog_id)) { - return td_api::make_object( - td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionSourceUser")); + return td_api::make_object( + td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChannel")); } - return td_api::make_object(); + return td_api::make_object(); } default: UNREACHABLE(); @@ -164,7 +164,7 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { }(); transactions.push_back(td_api::make_object( transaction->id_, StarManager::get_star_count(transaction->stars_, true), transaction->refund_, - transaction->date_, std::move(source))); + transaction->date_, std::move(partner))); } promise_.set_value(td_api::make_object(