aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/StoryInteractionInfo.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2023-08-14 00:40:46 +0300
committerlevlam <levlam@telegram.org>2023-08-14 00:40:46 +0300
commit60501c25ebfaaa83deeeb637ec5b180304a42aa0 (patch)
treede67d58fb497d8b1afc951a3a3eaa12c8ee00806 /td/telegram/StoryInteractionInfo.cpp
parenta867badcafdfbdff84952bca600fb851f46ad0a6 (diff)
Don't update recent viewers for stories with expired viewers.
Diffstat (limited to 'td/telegram/StoryInteractionInfo.cpp')
-rw-r--r--td/telegram/StoryInteractionInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/td/telegram/StoryInteractionInfo.cpp b/td/telegram/StoryInteractionInfo.cpp
index da6c23e73..6f1e620e3 100644
--- a/td/telegram/StoryInteractionInfo.cpp
+++ b/td/telegram/StoryInteractionInfo.cpp
@@ -51,6 +51,10 @@ void StoryInteractionInfo::add_dependencies(Dependencies &dependencies) const {
}
bool StoryInteractionInfo::set_recent_viewer_user_ids(vector<UserId> &&user_ids) {
+ if (recent_viewer_user_ids_.empty() && view_count_ > 0) {
+ // don't update recent viewers for stories with expired viewers
+ return false;
+ }
if (user_ids.size() > MAX_RECENT_VIEWERS) {
user_ids.resize(MAX_RECENT_VIEWERS);
}