Update allowed active_period values.

This commit is contained in:
levlam 2023-08-10 21:36:12 +03:00
parent b12ade01f6
commit 8d8cfb93d3
2 changed files with 2 additions and 3 deletions

View File

@ -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;

View File

@ -3717,8 +3717,7 @@ void StoryManager::send_story(td_api::object_ptr<td_api::InputStoryContent> &&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<int32>{6 * 3600, 12 * 3600, 2 * 86400, 3 * 86400, 7 * 86400}, active_period)) {
if (!is_premium || !td::contains(vector<int32>{6 * 3600, 12 * 3600, 2 * 86400}, active_period)) {
return promise.set_error(Status::Error(400, "Invalid story active period specified"));
}
}