Add options related to stealth mode.

This commit is contained in:
levlam 2023-08-03 17:38:56 +03:00
parent 8c7076fe97
commit 086df4db4e
3 changed files with 25 additions and 1 deletions

View File

@ -1892,6 +1892,21 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
G()->set_option_string("venue_search_bot_username", get_json_value_string(std::move(key_value->value_), key));
continue;
}
if (key == "stories_stealth_past_period") {
G()->set_option_integer("story_stealth_mode_past_period",
get_json_value_int(std::move(key_value->value_), key));
continue;
}
if (key == "stories_stealth_future_period") {
G()->set_option_integer("story_stealth_mode_future_period",
get_json_value_int(std::move(key_value->value_), key));
continue;
}
if (key == "stories_stealth_cooldown_period") {
G()->set_option_integer("story_stealth_mode_cooldown_period",
get_json_value_int(std::move(key_value->value_), key));
continue;
}
new_values.push_back(std::move(key_value));
}

View File

@ -102,7 +102,7 @@ class ConfigManager final : public NetQueryCallback {
private:
struct AppConfig {
static constexpr int32 CURRENT_VERSION = 9;
static constexpr int32 CURRENT_VERSION = 10;
int32 version_ = 0;
int32 hash_ = 0;
telegram_api::object_ptr<telegram_api::JSONValue> config_;

View File

@ -118,6 +118,15 @@ OptionManager::OptionManager(Td *td)
if (!have_option("archive_all_stories")) {
// set_option_boolean("archive_all_stories", false);
}
if (!have_option("story_stealth_mode_past_period")) {
set_option_integer("story_stealth_mode_past_period", 300);
}
if (!have_option("story_stealth_mode_future_period")) {
set_option_integer("story_stealth_mode_future_period", 1500);
}
if (!have_option("story_stealth_mode_cooldown_period")) {
set_option_integer("story_stealth_mode_cooldown_period", 3600);
}
set_option_empty("archive_and_mute_new_chats_from_unknown_users");
set_option_empty("chat_filter_count_max");