Add field Chat.has_private_forwards.

This commit is contained in:
levlam 2021-12-07 13:40:47 +03:00
parent 9f8606b612
commit 052032ee8b
2 changed files with 11 additions and 0 deletions

View File

@ -634,6 +634,9 @@ class Client::JsonChat : public Jsonable {
if (!user_info->bio.empty()) {
object("bio", user_info->bio);
}
if (user_info->has_private_forwards) {
object("has_private_forwards", td::JsonTrue());
}
}
break;
}
@ -4353,6 +4356,7 @@ void Client::on_update(object_ptr<td_api::Object> result) {
auto update = move_object_as<td_api::updateUserFullInfo>(result);
auto user_id = update->user_id_;
set_user_bio(user_id, std::move(update->user_full_info_->bio_));
set_user_has_private_forwards(user_id, update->user_full_info_->has_private_forwards_);
break;
}
case td_api::updateBasicGroup::ID: {
@ -8369,6 +8373,11 @@ void Client::set_user_bio(int64 user_id, td::string &&bio) {
user_info->bio = std::move(bio);
}
void Client::set_user_has_private_forwards(int64 user_id, bool has_private_forwards) {
auto user_info = &users_[user_id];
user_info->has_private_forwards = has_private_forwards;
}
void Client::add_group(std::unordered_map<int64, GroupInfo> &groups, object_ptr<td_api::basicGroup> &&group) {
auto group_info = &groups[group->id_];
group_info->member_count = group->member_count_;

View File

@ -580,9 +580,11 @@ class Client : public WebhookActor::Callback {
bool can_join_groups = false;
bool can_read_all_group_messages = false;
bool is_inline_bot = false;
bool has_private_forwards = false;
};
static void add_user(std::unordered_map<int64, UserInfo> &users, object_ptr<td_api::user> &&user);
void set_user_bio(int64 user_id, td::string &&bio);
void set_user_has_private_forwards(int64 user_id, bool has_private_forwards);
const UserInfo *get_user_info(int64 user_id) const;
struct GroupInfo {