diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 9dfe92b..6e3475c 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -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 result) { auto update = move_object_as(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 &groups, object_ptr &&group) { auto group_info = &groups[group->id_]; group_info->member_count = group->member_count_; diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index ced2af4..5cb52fe 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -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 &users, object_ptr &&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 {