Add User.is_premium.

This commit is contained in:
levlam 2022-05-24 16:56:53 +03:00
parent 7b20bdacdf
commit 897ddb64ce
2 changed files with 5 additions and 0 deletions

View File

@ -348,6 +348,9 @@ class Client::JsonUser final : public Jsonable {
if (user_info != nullptr && !user_info->language_code.empty()) { if (user_info != nullptr && !user_info->language_code.empty()) {
object("language_code", user_info->language_code); object("language_code", user_info->language_code);
} }
if (user_info != nullptr && user_info->is_premium) {
object("is_premium", td::JsonTrue());
}
if (user_info != nullptr && user_info->added_to_attachment_menu) { if (user_info != nullptr && user_info->added_to_attachment_menu) {
object("added_to_attachment_menu", td::JsonTrue()); object("added_to_attachment_menu", td::JsonTrue());
} }
@ -8920,6 +8923,7 @@ void Client::add_user(UserInfo *user_info, object_ptr<td_api::user> &&user) {
user_info->language_code = std::move(user->language_code_); user_info->language_code = std::move(user->language_code_);
user_info->have_access = user->have_access_; user_info->have_access = user->have_access_;
user_info->is_premium = user->is_premium_;
user_info->added_to_attachment_menu = user->added_to_attachment_menu_; user_info->added_to_attachment_menu = user->added_to_attachment_menu_;
switch (user->type_->get_id()) { switch (user->type_->get_id()) {

View File

@ -618,6 +618,7 @@ class Client final : public WebhookActor::Callback {
bool can_read_all_group_messages = false; bool can_read_all_group_messages = false;
bool is_inline_bot = false; bool is_inline_bot = false;
bool has_private_forwards = false; bool has_private_forwards = false;
bool is_premium = false;
bool added_to_attachment_menu = false; bool added_to_attachment_menu = false;
}; };
static void add_user(UserInfo *user_info, object_ptr<td_api::user> &&user); static void add_user(UserInfo *user_info, object_ptr<td_api::user> &&user);