Add "story_viewers_expiration_delay" option.

This commit is contained in:
levlam 2023-07-08 08:42:59 +03:00
parent dbed591a01
commit 3937eb7bdf
3 changed files with 4 additions and 3 deletions

View File

@ -2151,7 +2151,7 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
}
if (story_viewers_expire_period >= 0) {
options.set_option_integer("story_viewers_expire_period", story_viewers_expire_period);
options.set_option_integer("story_viewers_expiration_delay", story_viewers_expire_period);
}
if (!options.get_option_boolean("need_synchronize_archive_all_stories")) {
@ -2163,6 +2163,7 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
options.set_option_empty("default_ton_blockchain_config");
options.set_option_empty("default_ton_blockchain_name");
options.set_option_empty("story_viewers_expire_period");
// do not update suggested actions while changing content settings or dismissing an action
if (!is_set_content_settings_request_sent_ && dismiss_suggested_action_request_count_ == 0) {

View File

@ -296,7 +296,7 @@ bool OptionManager::is_internal_option(Slice name) {
name == "saved_gifs_limit_premium" || name == "session_count" || name == "since_last_open" ||
name == "stickers_faved_limit_default" || name == "stickers_faved_limit_premium" ||
name == "stickers_normal_by_emoji_per_premium_num" || name == "stickers_premium_by_emoji_num" ||
name == "stories_changelog_user_id" || name == "story_viewers_expire_period";
name == "stories_changelog_user_id";
case 'v':
return name == "video_note_size_max";
case 'w':

View File

@ -969,7 +969,7 @@ bool StoryManager::is_active_story(const Story *story) {
int32 StoryManager::get_story_viewers_expire_date(const Story *story) const {
return story->expire_date_ +
narrow_cast<int32>(td_->option_manager_->get_option_integer("story_viewers_expire_period", 86400));
narrow_cast<int32>(td_->option_manager_->get_option_integer("story_viewers_expiration_delay", 86400));
}
const StoryManager::Story *StoryManager::get_story(StoryFullId story_full_id) const {