0
0
Fork 0

Add reblogs and favourites counts to statuses in ActivityPub (#32007)

This commit is contained in:
Eugen Rochko 2024-09-23 15:14:15 +02:00 committed by GitHub
parent b5bdc69f7b
commit aaab6b7adc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 105 additions and 1 deletions

View file

@ -74,6 +74,18 @@ class ActivityPub::TagManager
account_status_replies_url(target.account, target, page_params)
end
def likes_uri_for(target)
raise ArgumentError, 'target must be a local activity' unless %i(note comment activity).include?(target.object_type) && target.local?
account_status_likes_url(target.account, target)
end
def shares_uri_for(target)
raise ArgumentError, 'target must be a local activity' unless %i(note comment activity).include?(target.object_type) && target.local?
account_status_shares_url(target.account, target)
end
def followers_uri_for(target)
target.local? ? account_followers_url(target) : target.followers_url.presence
end