diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 7bc2628de..8562f794e 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -864,11 +864,11 @@ starTransactionPartnerGooglePlay = StarTransactionPartner; //@description The transaction is a transaction with Fragment @withdrawal_state State of the withdrawal; may be null for refunds from Fragment 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 +//@description The transaction is a transaction with a bot +//@bot_user_id Identifier of the bot +//@product_info Information about the bought product; may be null if not applicable //@invoice_payload Invoice payload; for bots only -starTransactionPartnerUser user_id:int53 product_info:productInfo invoice_payload:bytes = StarTransactionPartner; +starTransactionPartnerBot bot_user_id:int53 product_info:productInfo invoice_payload:bytes = StarTransactionPartner; //@description The transaction is a transaction with a channel chat @chat_id Identifier of the chat starTransactionPartnerChannel chat_id:int53 = StarTransactionPartner; diff --git a/td/telegram/StarManager.cpp b/td/telegram/StarManager.cpp index d64748088..27f841385 100644 --- a/td/telegram/StarManager.cpp +++ b/td/telegram/StarManager.cpp @@ -167,17 +167,23 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { DialogId dialog_id( static_cast(transaction->peer_.get())->peer_); if (dialog_id.get_type() == DialogType::User) { + auto user_id = dialog_id.get_user_id(); + if (td_->auth_manager_->is_bot() == td_->user_manager_->is_user_bot(user_id)) { + LOG(ERROR) << "Receive star transaction with " << user_id; + return td_api::make_object(); + } SCOPE_EXIT { bot_payload.clear(); }; - return td_api::make_object( - td_->user_manager_->get_user_id_object(dialog_id.get_user_id(), "starTransactionPartnerUser"), - std::move(product_info), bot_payload); + return td_api::make_object( + td_->user_manager_->get_user_id_object(user_id, "starTransactionPartnerBot"), std::move(product_info), + bot_payload); } if (td_->dialog_manager_->is_broadcast_channel(dialog_id)) { return td_api::make_object( td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChannel")); } + LOG(ERROR) << "Receive star transaction with " << dialog_id; return td_api::make_object(); } case telegram_api::starsTransactionPeerAds::ID: {