Skip to content

Commit

Permalink
add f/f reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
jtomchak committed Oct 27, 2023
1 parent 6a19171 commit 233120d
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion app/lib/mammoth/status_origin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,22 @@ class StatusOrigin
include Redisable
class NotFound < StandardError; end


# Add Trending Follows and Reason
def add_trending_follows(status, user)
list_key = key(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])
reason = trending_fof_reason(status)

add_reason(list_key, reason)
end

# Add Status and Reason to list
def add_channel(status, channel)
list_key = key(status[:id])
Expand All @@ -18,6 +33,7 @@ def add_channel(status, channel)
add_reason(list_key, reason)
end

# Add MammothPick and Reason to list
def add_mammoth_pick(status)
list_key = key(status[:id])
reason = mammoth_pick_reason(status)
Expand Down Expand Up @@ -63,5 +79,13 @@ def channel_reason(status, channel)
def mammoth_pick_reason(status)
Oj.dump({source: "MammothPick", originating_account_id: status.account[:id] })
end

def trending_follow_reason(status)
Oj.dump({source: "TrendingFollows", originating_account_id: status.account[:id] })
end

def trending_fof_reason(status)
Oj.dump({source: "FriendsOfFriends", originating_account_id: status.account[:id] })
end
end
end

0 comments on commit 233120d

Please sign in to comment.