From fbc493c3618d36c39104cbda192373e781449e2c Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 29 Dec 2022 21:11:42 +0300 Subject: [PATCH] Add Chat.has_aggressive_anti_spam_enabled. --- telegram-bot-api/Client.cpp | 9 +++++++++ telegram-bot-api/Client.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 33eb28a..bb32a21 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -793,6 +793,9 @@ class Client::JsonChat final : public Jsonable { if (supergroup_info->is_supergroup && supergroup_info->has_hidden_members) { object("has_hidden_members", td::JsonTrue()); } + if (supergroup_info->has_aggressive_anti_spam_enabled) { + object("has_aggressive_anti_spam_enabled", td::JsonTrue()); + } if (supergroup_info->slow_mode_delay != 0) { object("slow_mode_delay", supergroup_info->slow_mode_delay); } @@ -5060,6 +5063,7 @@ void Client::on_update(object_ptr result) { 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_); + set_supergroup_has_aggressive_anti_spam_enabled(supergroup_id, full_info->has_aggressive_anti_spam_enabled_); break; } case td_api::updateOption::ID: { @@ -9789,6 +9793,11 @@ void Client::set_supergroup_has_hidden_members(int64 supergroup_id, bool has_hid add_supergroup_info(supergroup_id)->has_hidden_members = has_hidden_members; } +void Client::set_supergroup_has_aggressive_anti_spam_enabled(int64 supergroup_id, + bool has_aggressive_anti_spam_enabled) { + add_supergroup_info(supergroup_id)->has_aggressive_anti_spam_enabled = has_aggressive_anti_spam_enabled; +} + 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 2878593..166ad2c 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -712,6 +712,7 @@ class Client final : public WebhookActor::Callback { bool join_to_send_messages = false; bool join_by_request = false; bool has_hidden_members = false; + bool has_aggressive_anti_spam_enabled = false; }; static void add_supergroup(SupergroupInfo *supergroup_info, object_ptr &&supergroup); void set_supergroup_photo(int64 supergroup_id, object_ptr &&photo); @@ -723,6 +724,7 @@ class Client final : public WebhookActor::Callback { 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); + void set_supergroup_has_aggressive_anti_spam_enabled(int64 supergroup_id, bool has_aggressive_anti_spam_enabled); SupergroupInfo *add_supergroup_info(int64 supergroup_id); const SupergroupInfo *get_supergroup_info(int64 supergroup_id) const;