Improve name of starTransactionPartnerBot.

This commit is contained in:
levlam 2024-06-21 14:45:12 +03:00
parent e187c0ac3c
commit 78aae0b3f3
2 changed files with 13 additions and 7 deletions

View File

@ -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;

View File

@ -167,17 +167,23 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler {
DialogId dialog_id(
static_cast<const telegram_api::starsTransactionPeer *>(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<td_api::starTransactionPartnerUnsupported>();
}
SCOPE_EXIT {
bot_payload.clear();
};
return td_api::make_object<td_api::starTransactionPartnerUser>(
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_api::starTransactionPartnerBot>(
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_api::starTransactionPartnerChannel>(
td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChannel"));
}
LOG(ERROR) << "Receive star transaction with " << dialog_id;
return td_api::make_object<td_api::starTransactionPartnerUnsupported>();
}
case telegram_api::starsTransactionPeerAds::ID: {