Remove "forum_member_count_min" option.

This commit is contained in:
levlam 2022-12-31 00:17:18 +03:00
parent b0bfdd2b35
commit 5ee9c7365b
3 changed files with 6 additions and 15 deletions

View File

@ -7358,7 +7358,7 @@ toggleSupergroupHasHiddenMembers supergroup_id:int53 has_hidden_members:Bool = O
//@has_aggressive_anti_spam_enabled The new value of has_aggressive_anti_spam_enabled
toggleSupergroupHasAggressiveAntiSpamEnabled supergroup_id:int53 has_aggressive_anti_spam_enabled:Bool = Ok;
//@description Toggles whether the supergroup is a forum; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup @is_forum New value of is_forum. A supergroup can be converted to a forum, only if it has at least getOption("forum_member_count_min") members
//@description Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be converted to forums @supergroup_id Identifier of the supergroup @is_forum New value of is_forum
toggleSupergroupIsForum supergroup_id:int53 is_forum:Bool = Ok;
//@description Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup

View File

@ -1492,7 +1492,6 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
bool is_premium_available = false;
int32 stickers_premium_by_emoji_num = 0;
int32 stickers_normal_by_emoji_per_premium_num = 2;
int32 forum_upgrade_participants_min = 200;
int32 telegram_antispam_group_size_min = 100;
int32 topics_pinned_limit = -1;
vector<string> fragment_prefixes;
@ -1500,9 +1499,10 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
for (auto &key_value : static_cast<telegram_api::jsonObject *>(config.get())->value_) {
Slice key = key_value->key_;
telegram_api::JSONValue *value = key_value->value_.get();
if (key == "default_emoji_statuses_stickerset_id" || key == "getfile_experimental_params" ||
key == "message_animated_emoji_max" || key == "reactions_in_chat_max" || key == "stickers_emoji_cache_time" ||
key == "test" || key == "upload_max_fileparts_default" || key == "upload_max_fileparts_premium" ||
if (key == "default_emoji_statuses_stickerset_id" || key == "forum_upgrade_participants_min" ||
key == "getfile_experimental_params" || key == "message_animated_emoji_max" ||
key == "reactions_in_chat_max" || key == "stickers_emoji_cache_time" || key == "test" ||
key == "upload_max_fileparts_default" || key == "upload_max_fileparts_premium" ||
key == "wallet_blockchain_name" || key == "wallet_config" || key == "wallet_enabled") {
continue;
}
@ -1843,10 +1843,6 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
G()->set_option_integer(key, setting_value);
continue;
}
if (key == "forum_upgrade_participants_min") {
forum_upgrade_participants_min = get_json_value_int(std::move(key_value->value_), key);
continue;
}
if (key == "telegram_antispam_user_id") {
auto setting_value = get_json_value_long(std::move(key_value->value_), key);
G()->set_option_integer("anti_spam_bot_user_id", setting_value);
@ -1970,9 +1966,6 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
} else {
options.set_option_integer("reactions_uniq_max", reactions_uniq_max);
}
if (forum_upgrade_participants_min >= 0) {
options.set_option_integer("forum_member_count_min", forum_upgrade_participants_min);
}
if (telegram_antispam_group_size_min >= 0) {
options.set_option_integer("aggressive_anti_spam_supergroup_member_count_min", telegram_antispam_group_size_min);
}

View File

@ -112,9 +112,6 @@ OptionManager::OptionManager(Td *td)
if (!have_option("chat_filter_chosen_chat_count_max")) {
set_option_integer("chat_filter_chosen_chat_count_max", G()->is_test_dc() ? 5 : 100);
}
if (!have_option("forum_member_count_min")) {
set_option_integer("forum_member_count_min", G()->is_test_dc() ? 3 : 100);
}
if (!have_option("aggressive_anti_spam_supergroup_member_count_min")) {
set_option_integer("aggressive_anti_spam_supergroup_member_count_min", G()->is_test_dc() ? 1 : 100);
}
@ -122,6 +119,7 @@ OptionManager::OptionManager(Td *td)
set_option_integer("pinned_forum_topic_count_max", G()->is_test_dc() ? 3 : 5);
}
set_option_empty("forum_member_count_min");
set_option_empty("themed_emoji_statuses_sticker_set_id");
set_option_empty("themed_premium_statuses_sticker_set_id");
}