Add internal option "reactions_uniq_max".

This commit is contained in:
levlam 2022-01-25 22:53:51 +03:00
parent 74ac1f664b
commit d908117489
2 changed files with 14 additions and 4 deletions

View File

@ -1506,6 +1506,7 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
int64 chat_read_mark_size_threshold = 0;
double animated_emoji_zoom = 0.0;
string default_reaction;
int64 reactions_uniq_max = 0;
if (config->get_id() == telegram_api::jsonObject::ID) {
for (auto &key_value : static_cast<telegram_api::jsonObject *>(config.get())->value_) {
Slice key = key_value->key_;
@ -1750,6 +1751,10 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
default_reaction = get_json_value_string(std::move(key_value->value_), "reactions_default");
continue;
}
if (key == "reactions_uniq_max") {
reactions_uniq_max = get_json_value_int(std::move(key_value->value_), "reactions_uniq_max");
continue;
}
new_values.push_back(std::move(key_value));
}
@ -1826,6 +1831,11 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
if (!shared_config.have_option("default_reaction_need_sync")) {
shared_config.set_option_string("default_reaction", default_reaction);
}
if (reactions_uniq_max <= 0 || reactions_uniq_max == 11) {
shared_config.set_option_empty("reactions_uniq_max");
} else {
shared_config.set_option_integer("reactions_uniq_max", reactions_uniq_max);
}
shared_config.set_option_empty("default_ton_blockchain_config");
shared_config.set_option_empty("default_ton_blockchain_name");

View File

@ -111,7 +111,7 @@ bool OptionManager::is_internal_option(Slice name) {
case 'b':
return name == "base_language_pack_version";
case 'c':
return name == "call_ring_timeout_ms" || name == "call_receive_timeout_ms" ||
return name == "call_receive_timeout_ms" || name == "call_ring_timeout_ms" ||
name == "channels_read_media_period" || name == "chat_read_mark_expire_period" ||
name == "chat_read_mark_size_threshold";
case 'd':
@ -128,10 +128,10 @@ bool OptionManager::is_internal_option(Slice name) {
case 'n':
return name == "notification_cloud_delay_ms" || name == "notification_default_delay_ms";
case 'o':
return name == "online_update_period_ms" || name == "online_cloud_timeout_ms" || name == "otherwise_relogin_days";
return name == "online_cloud_timeout_ms" || name == "online_update_period_ms" || name == "otherwise_relogin_days";
case 'r':
return name == "revoke_pm_inbox" || name == "revoke_time_limit" || name == "revoke_pm_time_limit" ||
name == "rating_e_decay" || name == "recent_stickers_limit";
return name == "rating_e_decay" || name == "reactions_uniq_max" || name == "recent_stickers_limit" ||
name == "revoke_pm_inbox" || name == "revoke_time_limit" || name == "revoke_pm_time_limit";
case 's':
return name == "saved_animations_limit" || name == "session_count";
case 'v':