Add notification tone options.

This commit is contained in:
levlam 2022-04-12 18:15:45 +03:00
parent 7dc3966f18
commit 7aa5a0e348
2 changed files with 24 additions and 0 deletions

View File

@ -1764,6 +1764,21 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
reactions_uniq_max = get_json_value_int(std::move(key_value->value_), key);
continue;
}
if (key == "ringtone_duration_max") {
auto setting_value = get_json_value_int(std::move(key_value->value_), key);
G()->shared_config().set_option_integer("notification_tone_duration_max", setting_value);
continue;
}
if (key == "ringtone_size_max") {
auto setting_value = get_json_value_int(std::move(key_value->value_), key);
G()->shared_config().set_option_integer("notification_tone_size_max", setting_value);
continue;
}
if (key == "ringtone_saved_count_max") {
auto setting_value = get_json_value_int(std::move(key_value->value_), key);
G()->shared_config().set_option_integer("notification_tone_count_max", setting_value);
continue;
}
new_values.push_back(std::move(key_value));
}

View File

@ -3855,6 +3855,15 @@ void Td::init_options_and_network() {
if (!G()->shared_config().have_option("suggested_video_note_audio_bitrate")) {
G()->shared_config().set_option_integer("suggested_video_note_audio_bitrate", 64);
}
if (!G()->shared_config().have_option("notification_tone_duration_max")) {
G()->shared_config().set_option_integer("notification_tone_duration_max", 5);
}
if (!G()->shared_config().have_option("notification_tone_size_max")) {
G()->shared_config().set_option_integer("notification_tone_size_max", 307200);
}
if (!G()->shared_config().have_option("notification_tone_count_max")) {
G()->shared_config().set_option_integer("notification_tone_count_max", G()->is_test_dc() ? 5 : 100);
}
G()->shared_config().set_option_integer("utc_time_offset", Clocks::tz_offset());
init_connection_creator();