Add td_api::updateStarRevenueStatus.
This commit is contained in:
parent
40f6c540dd
commit
5d73204805
@ -7440,6 +7440,11 @@ updateOwnedStarCount star_count:int53 = Update;
|
||||
//@revenue_amount New amount of earned revenue
|
||||
updateChatRevenueAmount chat_id:int53 revenue_amount:chatRevenueAmount = Update;
|
||||
|
||||
//@description The Telegram star revenue earned by a bot or a chat has changed. If star transactions screen of the chat is opened, then getStarTransactions may be called to fetch new transactions
|
||||
//@owner_id Identifier of the owner of the Telegram stars
|
||||
//@status New Telegram star revenue status
|
||||
updateStarRevenueStatus owner_id:MessageSender status:starRevenueStatus = Update;
|
||||
|
||||
//@description The parameters of speech recognition without Telegram Premium subscription has changed
|
||||
//@max_media_duration The maximum allowed duration of media for speech recognition without Telegram Premium subscription, in seconds
|
||||
//@weekly_count The total number of allowed speech recognitions per week; 0 if none
|
||||
|
@ -378,6 +378,19 @@ void StarManager::send_get_star_withdrawal_url_query(
|
||||
->send(dialog_id, star_count, std::move(input_check_password));
|
||||
}
|
||||
|
||||
void StarManager::on_update_stars_revenue_status(
|
||||
telegram_api::object_ptr<telegram_api::updateStarsRevenueStatus> &&update) {
|
||||
DialogId dialog_id(update->peer_);
|
||||
if (can_manage_stars(dialog_id).is_error()) {
|
||||
LOG(ERROR) << "Receive " << to_string(update);
|
||||
return;
|
||||
}
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
td_api::make_object<td_api::updateStarRevenueStatus>(
|
||||
get_message_sender_object(td_, dialog_id, "updateStarRevenueStatus"),
|
||||
convert_stars_revenue_status(std::move(update->status_))));
|
||||
}
|
||||
|
||||
int64 StarManager::get_star_count(int64 amount) {
|
||||
if (amount < 0) {
|
||||
LOG(ERROR) << "Receive star amount = " << amount;
|
||||
|
@ -38,6 +38,8 @@ class StarManager final : public Actor {
|
||||
void get_star_withdrawal_url(const td_api::object_ptr<td_api::MessageSender> &owner_id, int64 star_count,
|
||||
const string &password, Promise<string> &&promise);
|
||||
|
||||
void on_update_stars_revenue_status(telegram_api::object_ptr<telegram_api::updateStarsRevenueStatus> &&update);
|
||||
|
||||
static int64 get_star_count(int64 amount);
|
||||
|
||||
private:
|
||||
|
@ -4575,14 +4575,15 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateStarsBalance> u
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
|
||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateStarsRevenueStatus> update, Promise<Unit> &&promise) {
|
||||
td_->star_manager_->on_update_stars_revenue_status(std::move(update));
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
|
||||
// unsupported updates
|
||||
|
||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateNewStoryReaction> update, Promise<Unit> &&promise) {
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
|
||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateStarsRevenueStatus> update, Promise<Unit> &&promise) {
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
|
||||
} // namespace td
|
||||
|
@ -674,11 +674,11 @@ class UpdatesManager final : public Actor {
|
||||
|
||||
void on_update(tl_object_ptr<telegram_api::updateStarsBalance> update, Promise<Unit> &&promise);
|
||||
|
||||
void on_update(tl_object_ptr<telegram_api::updateStarsRevenueStatus> update, Promise<Unit> &&promise);
|
||||
|
||||
// unsupported updates
|
||||
|
||||
void on_update(tl_object_ptr<telegram_api::updateNewStoryReaction> update, Promise<Unit> &&promise);
|
||||
|
||||
void on_update(tl_object_ptr<telegram_api::updateStarsRevenueStatus> update, Promise<Unit> &&promise);
|
||||
};
|
||||
|
||||
} // namespace td
|
||||
|
Loading…
x
Reference in New Issue
Block a user