Added is_verified and is_scam to User and Chat objects

This commit is contained in:
Jannik 2020-11-18 15:11:47 +01:00 committed by GitHub
parent a9897e44fd
commit e79d3b775e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,6 +329,12 @@ class Client::JsonUser : 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_verified) {
object("is_verified", td::JsonBool(user_info->is_verified));
}
if (user_info != nullptr && user_info->is_scam) {
object("is_scam", td::JsonBool(user_info->is_scam));
}
if (is_bot && full_bot_info_) { if (is_bot && full_bot_info_) {
object("can_join_groups", td::JsonBool(user_info->can_join_groups)); object("can_join_groups", td::JsonBool(user_info->can_join_groups));
object("can_read_all_group_messages", td::JsonBool(user_info->can_read_all_group_messages)); object("can_read_all_group_messages", td::JsonBool(user_info->can_read_all_group_messages));
@ -582,6 +588,12 @@ class Client::JsonChat : public Jsonable {
object("username", user_info->username); object("username", user_info->username);
} }
object("type", "private"); object("type", "private");
if (user_info->is_verified) {
object("is_verified", td::JsonBool(user_info->is_verified));
}
if (user_info->is_scam) {
object("is_scam", td::JsonBool(user_info->is_scam));
}
if (is_full_) { if (is_full_) {
if (!user_info->bio.empty()) { if (!user_info->bio.empty()) {
object("bio", user_info->bio); object("bio", user_info->bio);
@ -627,6 +639,12 @@ class Client::JsonChat : public Jsonable {
} else { } else {
object("type", "channel"); object("type", "channel");
} }
if (supergroup_info->is_verified) {
object("is_verified", td::JsonBool(supergroup_info->is_verified));
}
if (supergroup_info->is_scam) {
object("is_scam", td::JsonBool(supergroup_info->is_scam));
}
if (is_full_) { if (is_full_) {
if (!supergroup_info->description.empty()) { if (!supergroup_info->description.empty()) {
object("description", supergroup_info->description); object("description", supergroup_info->description);
@ -7934,6 +7952,8 @@ void Client::add_user(std::unordered_map<int32, UserInfo> &users, object_ptr<td_
user_info->last_name = user->last_name_; user_info->last_name = user->last_name_;
user_info->username = user->username_; user_info->username = user->username_;
user_info->language_code = user->language_code_; user_info->language_code = user->language_code_;
user_info->is_verified = user->is_verified_;
user_info->is_scam = user->is_scam_;
user_info->have_access = user->have_access_; user_info->have_access = user->have_access_;
@ -8003,6 +8023,8 @@ void Client::add_supergroup(std::unordered_map<int32, SupergroupInfo> &supergrou
supergroup_info->status = std::move(supergroup->status_); supergroup_info->status = std::move(supergroup->status_);
supergroup_info->is_supergroup = !supergroup->is_channel_; supergroup_info->is_supergroup = !supergroup->is_channel_;
supergroup_info->has_location = supergroup->has_location_; supergroup_info->has_location = supergroup->has_location_;
supergroup_info->is_verified = supergroup->is_verified_;
supergroup_info->is_scam = supergroup->is_scam_;
} }
void Client::set_supergroup_description(int32 supergroup_id, td::string &&descripton) { void Client::set_supergroup_description(int32 supergroup_id, td::string &&descripton) {