Ignore story privacy settings for channel stories.

This commit is contained in:
levlam 2024-02-13 13:07:09 +03:00
parent 1c40ce963c
commit e9c8fb8cb4
2 changed files with 4 additions and 1 deletions

View File

@ -8425,7 +8425,7 @@ canSendStory chat_id:int53 = CanSendStoryResult;
//@content Content of the 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
//@privacy_settings The privacy settings for the story; ignored for stories sent to supergroup and channel chats
//@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
//@from_story_full_id Full identifier of the original story, which content was used to create the story
//@is_pinned Pass true to keep the story accessible after expiration

View File

@ -4708,6 +4708,9 @@ void StoryManager::send_story(DialogId dialog_id, td_api::object_ptr<td_api::Inp
TRY_RESULT_PROMISE(promise, content, get_input_story_content(td_, std::move(input_story_content), dialog_id));
TRY_RESULT_PROMISE(promise, caption,
get_formatted_text(td_, DialogId(), std::move(input_caption), is_bot, true, false, false));
if (dialog_id != td_->dialog_manager_->get_my_dialog_id()) {
settings = td_api::make_object<td_api::storyPrivacySettingsEveryone>();
}
TRY_RESULT_PROMISE(promise, privacy_rules,
UserPrivacySettingRules::get_user_privacy_setting_rules(td_, std::move(settings)));
unique_ptr<StoryForwardInfo> forward_info;