From 8d8cfb93d36e19151524f35447e28e992c37224e Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 10 Aug 2023 21:36:12 +0300 Subject: [PATCH] Update allowed active_period values. --- td/generate/scheme/td_api.tl | 2 +- td/telegram/StoryManager.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 333950f76..a6fd0d4da 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -7414,7 +7414,7 @@ getStory story_sender_chat_id:int53 story_id:int32 only_local:Bool = Story; //@areas Clickable rectangle areas to be shown on the story media; pass null if none //@caption Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters //@privacy_settings The privacy settings for the story -//@active_period Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, 2 * 86400, 3 * 86400, or 7 * 86400 for Telegram Premium users, and 86400 otherwise +//@active_period Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise //@is_pinned Pass true to keep the story accessible after expiration //@protect_content Pass true if the content of the story must be protected from forwarding and screenshotting sendStory content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 is_pinned:Bool protect_content:Bool = Story; diff --git a/td/telegram/StoryManager.cpp b/td/telegram/StoryManager.cpp index 2f99f973e..781f223c0 100644 --- a/td/telegram/StoryManager.cpp +++ b/td/telegram/StoryManager.cpp @@ -3717,8 +3717,7 @@ void StoryManager::send_story(td_api::object_ptr &&in UserPrivacySettingRules::get_user_privacy_setting_rules(td_, std::move(settings))); if (active_period != 86400 && !(G()->is_test_dc() && (active_period == 60 || active_period == 300))) { bool is_premium = td_->option_manager_->get_option_boolean("is_premium"); - if (!is_premium || - !td::contains(vector{6 * 3600, 12 * 3600, 2 * 86400, 3 * 86400, 7 * 86400}, active_period)) { + if (!is_premium || !td::contains(vector{6 * 3600, 12 * 3600, 2 * 86400}, active_period)) { return promise.set_error(Status::Error(400, "Invalid story active period specified")); } }