From b972cebad4299c26ed98723f3d80ebdcdf139423 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 29 Dec 2022 21:06:38 +0300 Subject: [PATCH] Add Chat.has_hidden_members. --- telegram-bot-api/Client.cpp | 8 ++++++++ telegram-bot-api/Client.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 678433c..33eb28a 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -790,6 +790,9 @@ class Client::JsonChat final : public Jsonable { if (supergroup_info->is_supergroup && supergroup_info->join_by_request) { object("join_by_request", td::JsonTrue()); } + if (supergroup_info->is_supergroup && supergroup_info->has_hidden_members) { + object("has_hidden_members", td::JsonTrue()); + } if (supergroup_info->slow_mode_delay != 0) { object("slow_mode_delay", supergroup_info->slow_mode_delay); } @@ -5056,6 +5059,7 @@ void Client::on_update(object_ptr result) { set_supergroup_slow_mode_delay(supergroup_id, full_info->slow_mode_delay_); set_supergroup_linked_chat_id(supergroup_id, full_info->linked_chat_id_); set_supergroup_location(supergroup_id, std::move(full_info->location_)); + set_supergroup_has_hidden_members(supergroup_id, full_info->has_hidden_members_); break; } case td_api::updateOption::ID: { @@ -9781,6 +9785,10 @@ void Client::set_supergroup_location(int64 supergroup_id, object_ptrlocation = std::move(location); } +void Client::set_supergroup_has_hidden_members(int64 supergroup_id, bool has_hidden_members) { + add_supergroup_info(supergroup_id)->has_hidden_members = has_hidden_members; +} + Client::SupergroupInfo *Client::add_supergroup_info(int64 supergroup_id) { auto &supergroup_info = supergroups_[supergroup_id]; if (supergroup_info == nullptr) { diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index 8ad0e21..2878593 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -711,6 +711,7 @@ class Client final : public WebhookActor::Callback { bool has_location = false; bool join_to_send_messages = false; bool join_by_request = false; + bool has_hidden_members = false; }; static void add_supergroup(SupergroupInfo *supergroup_info, object_ptr &&supergroup); void set_supergroup_photo(int64 supergroup_id, object_ptr &&photo); @@ -721,6 +722,7 @@ class Client final : public WebhookActor::Callback { void set_supergroup_slow_mode_delay(int64 supergroup_id, int32 slow_mode_delay); void set_supergroup_linked_chat_id(int64 supergroup_id, int64 linked_chat_id); void set_supergroup_location(int64 supergroup_id, object_ptr location); + void set_supergroup_has_hidden_members(int64 supergroup_id, bool has_hidden_members); SupergroupInfo *add_supergroup_info(int64 supergroup_id); const SupergroupInfo *get_supergroup_info(int64 supergroup_id) const;