Add Chat.has_aggressive_anti_spam_enabled.

This commit is contained in:
levlam 2022-12-29 21:11:42 +03:00
parent b972cebad4
commit fbc493c361
2 changed files with 11 additions and 0 deletions

View File

@ -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<td_api::Object> 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) {

View File

@ -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<td_api::supergroup> &&supergroup);
void set_supergroup_photo(int64 supergroup_id, object_ptr<td_api::chatPhoto> &&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<td_api::chatLocation> 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;