Browse Source

Activity sort: don't bump from deep-nested replies

I'm not totally sure about this and it probably shouldn't *always* work
this way, but I want to try it.
merge-requests/85/head
Deimos 5 years ago
parent
commit
73e94ca7c2
  1. 4
      tildes/consumers/topic_interesting_activity_updater.py

4
tildes/consumers/topic_interesting_activity_updater.py

@ -42,6 +42,10 @@ class TopicInterestingActivityUpdater(PgsqlQueueConsumer):
def _find_last_interesting_time(self, comment: CommentInTree) -> Optional[datetime]:
"""Recursively find the last "interesting" time from a comment and replies."""
# stop considering comments interesting once they get too deep down a branch
if comment.depth >= 5:
return None
# if the comment has one of these labels, don't look any deeper down this branch
uninteresting_labels = ("noise", "offtopic", "malice")
if any(comment.is_label_active(label) for label in uninteresting_labels):

Loading…
Cancel
Save