Add story.can_be_replied.

This commit is contained in:
levlam 2023-06-27 17:29:30 +03:00
parent 09a30a4b3c
commit 3854a8b872
2 changed files with 4 additions and 2 deletions

View File

@ -4925,12 +4925,13 @@ storyInteractionInfo view_count:int32 recent_viewer_user_ids:vector<int53> = Sto
//@is_pinned True, if the story is saved in the sender's profile and will be available there after expiration
//@is_visible_only_for_self True, if the story is visible only for the current user
//@can_be_forwarded True, if the story can be forwarded as a message. Otherwise, screenshots of the story must be also forbidden
//@can_be_replied True, if the story can be replied in the chat with the story sender
//@can_get_viewers True, users viewed the story can be received through getStoryViewers
//@interaction_info Information about interactions with the story; may be null if the story isn't owned or there were no interactions
//@privacy_rules Pryvacy rules affecting story visibility; may be null if the story isn't owned
//@content Content of the story
//@caption Caption of the story
story id:int32 sender_user_id:int53 date:int32 is_pinned:Bool is_visible_only_for_self:Bool can_be_forwarded:Bool can_get_viewers:Bool interaction_info:storyInteractionInfo privacy_rules:userPrivacySettingRules content:StoryContent caption:formattedText = Story;
story id:int32 sender_user_id:int53 date:int32 is_pinned:Bool is_visible_only_for_self:Bool can_be_forwarded:Bool can_be_replied:Bool can_get_viewers:Bool interaction_info:storyInteractionInfo privacy_rules:userPrivacySettingRules content:StoryContent caption:formattedText = Story;
//@description Represents a list of stories @total_count Approximate total number of stories found @stories The list of stories
stories total_count:int32 stories:vector<story> = Stories;

View File

@ -1417,6 +1417,7 @@ td_api::object_ptr<td_api::story> StoryManager::get_story_object(StoryFullId sto
bool can_be_forwarded = !story->noforwards_ && story_id.is_server() && privacy_rules != nullptr &&
privacy_rules->rules_.size() == 1u &&
privacy_rules->rules_[0]->get_id() == td_api::userPrivacySettingRuleAllowAll::ID;
bool can_be_replied = story_id.is_server() && dialog_id != DialogId(changelog_user_id);
story->is_update_sent_ = true;
@ -1424,7 +1425,7 @@ td_api::object_ptr<td_api::story> StoryManager::get_story_object(StoryFullId sto
return td_api::make_object<td_api::story>(
story_full_id.get_story_id().get(),
td_->contacts_manager_->get_user_id_object(dialog_id.get_user_id(), "get_story_object"), story->date_,
story->is_pinned_, is_visible_only_for_self, can_be_forwarded,
story->is_pinned_, is_visible_only_for_self, can_be_forwarded, can_be_replied,
can_get_story_viewers(story_full_id, story).is_ok(),
story->interaction_info_.get_story_interaction_info_object(td_), std::move(privacy_rules),
get_story_content_object(td_, content),