Fix: 引用投稿のActivity発行でエラーが出る問題 (#878)
This commit is contained in:
parent
df88076e68
commit
e080fae9ef
1 changed files with 18 additions and 7 deletions
|
@ -161,16 +161,27 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||||
object.active_mentions.to_a.sort_by(&:id) + object.tags + object.emojis + virtual_tags_of_quote
|
object.active_mentions.to_a.sort_by(&:id) + object.tags + object.emojis + virtual_tags_of_quote
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class NoteLink < ActiveModelSerializers::Model
|
||||||
|
attributes :href
|
||||||
|
end
|
||||||
|
|
||||||
|
class NoteLinkSerializer < ActivityPub::Serializer
|
||||||
|
attributes :type, :href
|
||||||
|
attribute :media_type, key: :mediaType
|
||||||
|
|
||||||
|
def type
|
||||||
|
'Link'
|
||||||
|
end
|
||||||
|
|
||||||
|
def media_type
|
||||||
|
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def virtual_tags_of_quote
|
def virtual_tags_of_quote
|
||||||
return [] unless object.quote?
|
return [] unless object.quote?
|
||||||
|
|
||||||
[
|
[NoteLink.new(href: quote_uri)]
|
||||||
{
|
|
||||||
type: 'Link',
|
|
||||||
mediaType: 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
|
|
||||||
href: quote_uri,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def atom_uri
|
def atom_uri
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue