|
|
@ -8,6 +8,8 @@ class ActivityPub::NoteSerializer < ActiveModel::Serializer
|
|
|
|
has_many :media_attachments, key: :attachment
|
|
|
|
has_many :media_attachments, key: :attachment
|
|
|
|
has_many :virtual_tags, key: :tag
|
|
|
|
has_many :virtual_tags, key: :tag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attribute :atom_uri, key: '_:atomUri', if: :local?
|
|
|
|
|
|
|
|
|
|
|
|
def id
|
|
|
|
def id
|
|
|
|
ActivityPub::TagManager.instance.uri_for(object)
|
|
|
|
ActivityPub::TagManager.instance.uri_for(object)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -52,6 +54,14 @@ class ActivityPub::NoteSerializer < ActiveModel::Serializer
|
|
|
|
object.mentions + object.tags
|
|
|
|
object.mentions + object.tags
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def atom_uri
|
|
|
|
|
|
|
|
::TagManager.instance.uri_for(object)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def local?
|
|
|
|
|
|
|
|
object.account.local?
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
class MediaAttachmentSerializer < ActiveModel::Serializer
|
|
|
|
class MediaAttachmentSerializer < ActiveModel::Serializer
|
|
|
|
include RoutingHelper
|
|
|
|
include RoutingHelper
|
|
|
|
|
|
|
|
|
|
|
|