Add td_api::updateOwnedStarCount.
This commit is contained in:
parent
be4543f77c
commit
7ab4d9b87b
@ -7286,6 +7286,9 @@ updateDefaultReactionType reaction_type:ReactionType = Update;
|
|||||||
//@tags The new tags
|
//@tags The new tags
|
||||||
updateSavedMessagesTags saved_messages_topic_id:int53 tags:savedMessagesTags = Update;
|
updateSavedMessagesTags saved_messages_topic_id:int53 tags:savedMessagesTags = Update;
|
||||||
|
|
||||||
|
//@description The number of stars owned by the current user has changed @star_count The new number of stars owned
|
||||||
|
updateOwnedStarCount star_count:int53 = Update;
|
||||||
|
|
||||||
//@description The revenue earned from sponsored messages in a chat has changed. If chat revenue screen is opened, then getChatRevenueTransactions may be called to fetch new transactions
|
//@description The revenue earned from sponsored messages in a chat has changed. If chat revenue screen is opened, then getChatRevenueTransactions may be called to fetch new transactions
|
||||||
//@chat_id Identifier of the chat
|
//@chat_id Identifier of the chat
|
||||||
//@revenue_amount New amount of earned revenue
|
//@revenue_amount New amount of earned revenue
|
||||||
|
@ -4560,14 +4560,19 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateBroadcastRevenu
|
|||||||
promise.set_value(Unit());
|
promise.set_value(Unit());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateStarsBalance> update, Promise<Unit> &&promise) {
|
||||||
|
if (update->balance_ < 0) {
|
||||||
|
LOG(ERROR) << "Receive " << update->balance_ << " stars";
|
||||||
|
update->balance_ = 0;
|
||||||
|
}
|
||||||
|
send_closure(G()->td(), &Td::send_update, td_api::make_object<td_api::updateOwnedStarCount>(update->balance_));
|
||||||
|
promise.set_value(Unit());
|
||||||
|
}
|
||||||
|
|
||||||
// unsupported updates
|
// unsupported updates
|
||||||
|
|
||||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateNewStoryReaction> update, Promise<Unit> &&promise) {
|
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateNewStoryReaction> update, Promise<Unit> &&promise) {
|
||||||
promise.set_value(Unit());
|
promise.set_value(Unit());
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateStarsBalance> update, Promise<Unit> &&promise) {
|
|
||||||
promise.set_value(Unit());
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace td
|
} // namespace td
|
||||||
|
@ -671,11 +671,11 @@ class UpdatesManager final : public Actor {
|
|||||||
|
|
||||||
void on_update(tl_object_ptr<telegram_api::updateBroadcastRevenueTransactions> update, Promise<Unit> &&promise);
|
void on_update(tl_object_ptr<telegram_api::updateBroadcastRevenueTransactions> update, Promise<Unit> &&promise);
|
||||||
|
|
||||||
|
void on_update(tl_object_ptr<telegram_api::updateStarsBalance> update, Promise<Unit> &&promise);
|
||||||
|
|
||||||
// unsupported updates
|
// unsupported updates
|
||||||
|
|
||||||
void on_update(tl_object_ptr<telegram_api::updateNewStoryReaction> update, Promise<Unit> &&promise);
|
void on_update(tl_object_ptr<telegram_api::updateNewStoryReaction> update, Promise<Unit> &&promise);
|
||||||
|
|
||||||
void on_update(tl_object_ptr<telegram_api::updateStarsBalance> update, Promise<Unit> &&promise);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace td
|
} // namespace td
|
||||||
|
Loading…
x
Reference in New Issue
Block a user