Add starTransactionPartnerUser.bot_payload.
This commit is contained in:
parent
5063f64bc6
commit
ce47a526c6
@ -864,8 +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
|
//@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;
|
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 another user
|
||||||
starTransactionPartnerUser user_id:int53 product_info:productInfo = StarTransactionPartner;
|
//@user_id Identifier of the user
|
||||||
|
//@product_info Information about the bought product; may be null if none
|
||||||
|
//@invoice_payload Invoice payload; for bots only
|
||||||
|
starTransactionPartnerUser 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
|
//@description The transaction is a transaction with a channel chat @chat_id Identifier of the chat
|
||||||
starTransactionPartnerChannel chat_id:int53 = StarTransactionPartner;
|
starTransactionPartnerChannel chat_id:int53 = StarTransactionPartner;
|
||||||
|
@ -111,10 +111,18 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler {
|
|||||||
vector<td_api::object_ptr<td_api::starTransaction>> transactions;
|
vector<td_api::object_ptr<td_api::starTransaction>> transactions;
|
||||||
for (auto &transaction : result->history_) {
|
for (auto &transaction : result->history_) {
|
||||||
td_api::object_ptr<td_api::productInfo> product_info;
|
td_api::object_ptr<td_api::productInfo> product_info;
|
||||||
|
string bot_payload;
|
||||||
if (!transaction->title_.empty() || !transaction->description_.empty() || transaction->photo_ != nullptr) {
|
if (!transaction->title_.empty() || !transaction->description_.empty() || transaction->photo_ != nullptr) {
|
||||||
auto photo = get_web_document_photo(td_->file_manager_.get(), std::move(transaction->photo_), DialogId());
|
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);
|
product_info = get_product_info_object(td_, transaction->title_, transaction->description_, photo);
|
||||||
}
|
}
|
||||||
|
if (!transaction->bot_payload_.empty()) {
|
||||||
|
if (td_->auth_manager_->is_bot()) {
|
||||||
|
bot_payload = transaction->bot_payload_.as_slice().str();
|
||||||
|
} else {
|
||||||
|
LOG(ERROR) << "Receive Star transaction with bot payload";
|
||||||
|
}
|
||||||
|
}
|
||||||
auto partner = [&]() -> td_api::object_ptr<td_api::StarTransactionPartner> {
|
auto partner = [&]() -> td_api::object_ptr<td_api::StarTransactionPartner> {
|
||||||
switch (transaction->peer_->get_id()) {
|
switch (transaction->peer_->get_id()) {
|
||||||
case telegram_api::starsTransactionPeerUnsupported::ID:
|
case telegram_api::starsTransactionPeerUnsupported::ID:
|
||||||
@ -150,7 +158,7 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler {
|
|||||||
if (dialog_id.get_type() == DialogType::User) {
|
if (dialog_id.get_type() == DialogType::User) {
|
||||||
return td_api::make_object<td_api::starTransactionPartnerUser>(
|
return td_api::make_object<td_api::starTransactionPartnerUser>(
|
||||||
td_->user_manager_->get_user_id_object(dialog_id.get_user_id(), "starTransactionPartnerUser"),
|
td_->user_manager_->get_user_id_object(dialog_id.get_user_id(), "starTransactionPartnerUser"),
|
||||||
std::move(product_info));
|
std::move(product_info), bot_payload);
|
||||||
}
|
}
|
||||||
if (td_->dialog_manager_->is_broadcast_channel(dialog_id)) {
|
if (td_->dialog_manager_->is_broadcast_channel(dialog_id)) {
|
||||||
return td_api::make_object<td_api::starTransactionPartnerChannel>(
|
return td_api::make_object<td_api::starTransactionPartnerChannel>(
|
||||||
|
Loading…
Reference in New Issue
Block a user