Merge remote-tracking branch 'tootsuite/master'
This commit is contained in:
@ -10,6 +10,8 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
|
||||
|
||||
has_one :public_key, serializer: ActivityPub::PublicKeySerializer
|
||||
|
||||
attribute :moved_to, if: :moved?
|
||||
|
||||
class EndpointsSerializer < ActiveModel::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
@ -25,6 +27,8 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
|
||||
has_one :icon, serializer: ActivityPub::ImageSerializer, if: :avatar_exists?
|
||||
has_one :image, serializer: ActivityPub::ImageSerializer, if: :header_exists?
|
||||
|
||||
delegate :moved?, to: :object
|
||||
|
||||
def id
|
||||
account_url(object)
|
||||
end
|
||||
@ -92,4 +96,8 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
|
||||
def manually_approves_followers
|
||||
object.locked
|
||||
end
|
||||
|
||||
def moved_to
|
||||
ActivityPub::TagManager.instance.uri_for(object.moved_to_account)
|
||||
end
|
||||
end
|
||||
|
@ -7,6 +7,10 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
||||
:note, :url, :avatar, :avatar_static, :header, :header_static,
|
||||
:followers_count, :following_count, :statuses_count
|
||||
|
||||
has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved?
|
||||
|
||||
delegate :moved?, to: :object
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
|
Reference in New Issue
Block a user