Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

/r/friends: pick friends based on commenting also

Previously, get_important_friends would exclude any friends that hadn't
submitted anything before. This change makes it so that people that only
comment will be included as well.
  • Loading branch information...
commit 15f84fb6a15728b6a3b02c0e2c0293ebf8d171a2 1 parent c9afabf
@Deimos Deimos authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 r2/r2/models/subreddit.py
View
9 r2/r2/models/subreddit.py
@@ -948,13 +948,12 @@ def get_important_friends(cls, user_id, max_lookup = 500, limit = 100):
friends = Account._byID(a.friends[-max_lookup:], return_dict = False,
data = True)
- # if we don't have a last visit for your friends, we don't
- # care about them
- last_visits = last_modified_multi(friends, "submitted")
- friends = [x for x in friends if x in last_visits]
+ # only include friends that have ever interacted with the site
+ last_activity = last_modified_multi(friends, "overview")
+ friends = [x for x in friends if x in last_activity]
# sort friends by most recent interactions
- friends.sort(key = lambda x: last_visits[x], reverse = True)
+ friends.sort(key = lambda x: last_activity[x], reverse = True)
return [x._id for x in friends[:limit]]
def get_links(self, sort, time):
Please sign in to comment.
Something went wrong with that request. Please try again.