Add "pinned_forum_topic_count_max" option.
This commit is contained in:
parent
86f0de23f5
commit
b203030e5c
@ -1494,6 +1494,7 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
|
||||
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;
|
||||
if (config->get_id() == telegram_api::jsonObject::ID) {
|
||||
for (auto &key_value : static_cast<telegram_api::jsonObject *>(config.get())->value_) {
|
||||
@ -1877,6 +1878,10 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
|
||||
G()->set_option_integer("hidden_members_group_size_min", setting_value);
|
||||
continue;
|
||||
}
|
||||
if (key == "topics_pinned_limit") {
|
||||
topics_pinned_limit = get_json_value_int(std::move(key_value->value_), key);
|
||||
continue;
|
||||
}
|
||||
|
||||
new_values.push_back(std::move(key_value));
|
||||
}
|
||||
@ -2007,6 +2012,11 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
|
||||
} else {
|
||||
options.set_option_string("premium_invoice_slug", premium_invoice_slug);
|
||||
}
|
||||
if (topics_pinned_limit >= 0) {
|
||||
options.set_option_integer("pinned_forum_topic_count_max", topics_pinned_limit);
|
||||
} else {
|
||||
options.set_option_empty("pinned_forum_topic_count_max");
|
||||
}
|
||||
|
||||
options.set_option_integer("stickers_premium_by_emoji_num", stickers_premium_by_emoji_num);
|
||||
options.set_option_integer("stickers_normal_by_emoji_per_premium_num", stickers_normal_by_emoji_per_premium_num);
|
||||
|
@ -118,6 +118,9 @@ OptionManager::OptionManager(Td *td)
|
||||
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);
|
||||
}
|
||||
if (!have_option("pinned_forum_topic_count_max")) {
|
||||
set_option_integer("pinned_forum_topic_count_max", G()->is_test_dc() ? 3 : 5);
|
||||
}
|
||||
|
||||
set_option_empty("themed_emoji_statuses_sticker_set_id");
|
||||
set_option_empty("themed_premium_statuses_sticker_set_id");
|
||||
|
Loading…
Reference in New Issue
Block a user