mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-26 12:12:43 +00:00
Implement FEP 7888: Part 1 - publish conversation context (#35959)
This commit is contained in:
parent
9463a31107
commit
65b4a0a6f1
15 changed files with 309 additions and 12 deletions
|
|
@ -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?
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue