Skip to content

Commit

Permalink
f/fof origin reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
jtomchak committed Oct 27, 2023
1 parent 233120d commit af973f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/lib/mammoth/status_origin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ class NotFound < StandardError; end

# Add Trending Follows and Reason
def add_trending_follows(status, user)
list_key = key(user[:acct])
list_key = key(status[:id], user[:acct])
reason = trending_follow_reason(status)

add_reason(list_key, reason)
end

# Add FOF and Reason to list
def add_friends_of_friends(status, user)
list_key = key(user[:acct])
list_key = key(status[:id], user[:acct])
reason = trending_fof_reason(status)

add_reason(list_key, reason)
Expand Down
10 changes: 8 additions & 2 deletions app/workers/update_for_you_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def following_status

@personal.statuses_for_direct_follows(@acct)
.filter_map { |s| engagment_threshold(s, user_setting[:your_follows], 'following') }
.pluck('id')
.map do |s|
origin.add_trending_follows(s, @user)
s['id']
end
end

# Indirect Follows
Expand All @@ -83,7 +86,10 @@ def indirect_following_status

@personal.statuses_for_indirect_follows(@account)
.filter_map { |s| engagment_threshold(s, user_setting[:friends_of_friends], 'indirect') }
.pluck('id')
.map do |s|
origin.add_friends_of_friends(s, @user)
s['id']
end
end

# Channels Subscribed
Expand Down

0 comments on commit af973f0

Please sign in to comment.