Add td_api::channelTransactionPurposeReaction.

This commit is contained in:
levlam 2024-07-26 16:56:24 +03:00
parent 62d1a85ab6
commit 908eb948f0
2 changed files with 22 additions and 0 deletions

View File

@ -895,6 +895,10 @@ channelTransactionPurposePaidMedia message_id:int53 media:vector<PaidMedia> = Ch
//@period The number of seconds between consecutive Telegram Star debiting
channelTransactionPurposeJoin period:int32 = ChannelTransactionPurpose;
//@description User paid for a reaction
//@message_id Identifier of the reacted message; can be an identifier of a deleted message
channelTransactionPurposeReaction message_id:int53 = ChannelTransactionPurpose;
//@class StarTransactionPartner @description Describes source or recipient of a transaction with Telegram Stars

View File

@ -283,6 +283,21 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler {
td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChannel"),
td_api::make_object<td_api::channelTransactionPurposeJoin>(transaction->subscription_period_));
}
if (transaction->reaction_) {
SCOPE_EXIT {
transaction->msg_id_ = 0;
transaction->reaction_ = false;
};
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();
}
td_->dialog_manager_->force_create_dialog(dialog_id, "starsTransactionPeer", true);
return td_api::make_object<td_api::starTransactionPartnerChannel>(
td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChannel"),
td_api::make_object<td_api::channelTransactionPurposeReaction>(message_id.get()));
}
SCOPE_EXIT {
transaction->msg_id_ = 0;
@ -341,6 +356,9 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler {
if (transaction->subscription_period_ != 0) {
LOG(ERROR) << "Receive subscription period with " << to_string(star_transaction);
}
if (transaction->reaction_) {
LOG(ERROR) << "Receive reaction with " << to_string(star_transaction);
}
}
if (!file_ids.empty()) {
auto file_source_id =