Add "archive_all_stories" option.

This commit is contained in:
levlam 2023-06-16 14:58:06 +03:00
parent 509dd95882
commit 4c1ee918b3
3 changed files with 11 additions and 1 deletions

View File

@ -1559,6 +1559,7 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
bool premium_gift_attach_menu_icon = false; bool premium_gift_attach_menu_icon = false;
bool premium_gift_text_field_icon = false; bool premium_gift_text_field_icon = false;
int32 dialog_filter_update_period = 300; int32 dialog_filter_update_period = 300;
bool archive_all_stories = false;
if (config->get_id() == telegram_api::jsonObject::ID) { if (config->get_id() == telegram_api::jsonObject::ID) {
for (auto &key_value : static_cast<telegram_api::jsonObject *>(config.get())->value_) { for (auto &key_value : static_cast<telegram_api::jsonObject *>(config.get())->value_) {
Slice key = key_value->key_; Slice key = key_value->key_;
@ -1955,6 +1956,10 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
dialog_filter_update_period = get_json_value_int(std::move(key_value->value_), key); dialog_filter_update_period = get_json_value_int(std::move(key_value->value_), key);
continue; continue;
} }
if (key == "stories_all_hidden") {
archive_all_stories = get_json_value_bool(std::move(key_value->value_), key);
continue;
}
new_values.push_back(std::move(key_value)); new_values.push_back(std::move(key_value));
} }
@ -2121,6 +2126,8 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
options.set_option_empty("gift_premium_from_input_field"); options.set_option_empty("gift_premium_from_input_field");
} }
options.set_option_boolean("archive_all_stories", archive_all_stories);
options.set_option_integer("stickers_premium_by_emoji_num", stickers_premium_by_emoji_num); 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); options.set_option_integer("stickers_normal_by_emoji_per_premium_num", stickers_normal_by_emoji_per_premium_num);

View File

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

View File

@ -109,6 +109,9 @@ OptionManager::OptionManager(Td *td)
if (!have_option("pinned_forum_topic_count_max")) { if (!have_option("pinned_forum_topic_count_max")) {
set_option_integer("pinned_forum_topic_count_max", G()->is_test_dc() ? 3 : 5); set_option_integer("pinned_forum_topic_count_max", G()->is_test_dc() ? 3 : 5);
} }
if (!have_option("archive_all_stories")) {
set_option_boolean("archive_all_stories", false);
}
set_option_empty("chat_filter_count_max"); set_option_empty("chat_filter_count_max");
set_option_empty("chat_filter_chosen_chat_count_max"); set_option_empty("chat_filter_chosen_chat_count_max");