Add starTransactionPartnerChannel.paid_media_message_id.

This commit is contained in:
levlam 2024-06-21 15:06:54 +03:00
parent ab0a1fc9ee
commit 0115a73d6e
2 changed files with 17 additions and 3 deletions

View File

@ -870,8 +870,10 @@ starTransactionPartnerFragment withdrawal_state:RevenueWithdrawalState = StarTra
//@invoice_payload Invoice payload; for bots only
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;
//@description The transaction is a transaction with a channel chat
//@chat_id Identifier of the chat
//@paid_media_message_id Identifier of the corresponding message with paid media; can be an identifier of a deleted message
starTransactionPartnerChannel chat_id:int53 paid_media_message_id:int53 = StarTransactionPartner;
//@description The transaction is a transaction with unknown partner
starTransactionPartnerUnsupported = StarTransactionPartner;

View File

@ -181,8 +181,17 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler {
bot_payload);
}
if (td_->dialog_manager_->is_broadcast_channel(dialog_id)) {
SCOPE_EXIT {
transaction->msg_id_ = 0;
};
auto message_id = MessageId(ServerMessageId(transaction->msg_id_));
if (message_id != MessageId() && !message_id.is_valid()) {
LOG(ERROR) << "Receive " << message_id << " in " << to_string(transaction);
message_id = MessageId();
}
return td_api::make_object<td_api::starTransactionPartnerChannel>(
td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChannel"));
td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChannel"),
message_id.get());
}
LOG(ERROR) << "Receive star transaction with " << dialog_id;
return td_api::make_object<td_api::starTransactionPartnerUnsupported>();
@ -208,6 +217,9 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler {
transaction->failed_) {
LOG(ERROR) << "Receive withdrawal state with " << to_string(star_transaction);
}
if (transaction->msg_id_ != 0) {
LOG(ERROR) << "Receive message identifier with " << to_string(star_transaction);
}
}
transactions.push_back(std::move(star_transaction));
}