Implement FEP 7888: Part 1 - publish conversation context (#35959)

This commit is contained in:
Jesse Karmani 2025-09-05 12:28:29 -07:00 committed by GitHub
parent 9463a31107
commit 65b4a0a6f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 309 additions and 12 deletions

View file

@ -40,6 +40,8 @@ class ActivityPub::TagManager
case target.object_type
when :person
target.instance_actor? ? instance_actor_url : account_url(target)
when :conversation
context_url(target)
when :note, :comment, :activity
return activity_account_status_url(target.account, target) if target.reblog?
@ -76,6 +78,12 @@ class ActivityPub::TagManager
activity_account_status_url(target.account, target)
end
def context_uri_for(target, page_params = nil)
raise ArgumentError, 'target must be a local activity' unless %i(note comment activity).include?(target.object_type) && target.local?
items_context_url(target.conversation, page_params)
end
def replies_uri_for(target, page_params = nil)
raise ArgumentError, 'target must be a local activity' unless %i(note comment activity).include?(target.object_type) && target.local?