Improve StoryManager::can_get_story_viewers.
This commit is contained in:
parent
23212a271a
commit
ca78c82e36
@ -38,6 +38,10 @@ class StoryInteractionInfo {
|
||||
return view_count_ < 0;
|
||||
}
|
||||
|
||||
bool has_hidden_viewers() const {
|
||||
return view_count_ < 0 || (recent_viewer_user_ids_.empty() && view_count_ > 0);
|
||||
}
|
||||
|
||||
void add_dependencies(Dependencies &dependencies) const;
|
||||
|
||||
bool set_counts(int32 view_count, int32 reaction_count) {
|
||||
|
@ -2345,7 +2345,7 @@ Status StoryManager::can_get_story_viewers(StoryFullId story_full_id, const Stor
|
||||
return Status::Error(400, "Story is not sent yet");
|
||||
}
|
||||
if (G()->unix_time() >= get_story_viewers_expire_date(story) &&
|
||||
(ignore_premium || story->interaction_info_.is_empty())) {
|
||||
(ignore_premium || story->interaction_info_.has_hidden_viewers())) {
|
||||
return Status::Error(400, "Story is too old");
|
||||
}
|
||||
return Status::OK();
|
||||
|
Loading…
x
Reference in New Issue
Block a user