mirror of https://github.com/tootsuite/mastodon
[WiP] Fix some hardcoded routes in ActivityPub URI generation
parent
df91732b9b
commit
803fba1d3a
|
@ -99,7 +99,7 @@ class ActivityPub::TagManager
|
||||||
when 'public'
|
when 'public'
|
||||||
[COLLECTIONS[:public]]
|
[COLLECTIONS[:public]]
|
||||||
when 'unlisted', 'private'
|
when 'unlisted', 'private'
|
||||||
[account_followers_url(status.account)]
|
[followers_uri_for(status.account)]
|
||||||
when 'direct', 'limited'
|
when 'direct', 'limited'
|
||||||
if status.account.silenced?
|
if status.account.silenced?
|
||||||
# Only notify followers if the account is locally silenced
|
# Only notify followers if the account is locally silenced
|
||||||
|
@ -133,7 +133,7 @@ class ActivityPub::TagManager
|
||||||
|
|
||||||
case status.visibility
|
case status.visibility
|
||||||
when 'public'
|
when 'public'
|
||||||
cc << account_followers_url(status.account)
|
cc << followers_uri_for(status.account)
|
||||||
when 'unlisted'
|
when 'unlisted'
|
||||||
cc << COLLECTIONS[:public]
|
cc << COLLECTIONS[:public]
|
||||||
end
|
end
|
||||||
|
|
|
@ -44,7 +44,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
|
||||||
delegate :suspended?, :instance_actor?, to: :object
|
delegate :suspended?, :instance_actor?, to: :object
|
||||||
|
|
||||||
def id
|
def id
|
||||||
object.instance_actor? ? instance_actor_url : account_url(object)
|
ActivityPub::TagManager.instance.uri_for(object)
|
||||||
end
|
end
|
||||||
|
|
||||||
def type
|
def type
|
||||||
|
|
|
@ -13,7 +13,7 @@ class WebfingerSerializer < ActiveModel::Serializer
|
||||||
if object.instance_actor?
|
if object.instance_actor?
|
||||||
[instance_actor_url]
|
[instance_actor_url]
|
||||||
else
|
else
|
||||||
[short_account_url(object), account_url(object)]
|
[short_account_url(object), ActivityPub::TagManager.instance.uri_for(object)]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -43,6 +43,6 @@ class WebfingerSerializer < ActiveModel::Serializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def self_href
|
def self_href
|
||||||
object.instance_actor? ? instance_actor_url : account_url(object)
|
ActivityPub::TagManager.instance.uri_for(object)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue