mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-25 15:09:29 +00:00
Add account hashtags to ActivityPub actor JSON (#9450)
This commit is contained in:
parent
426d7191d9
commit
6d2080a74b
|
@ -105,7 +105,7 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def virtual_tags
|
def virtual_tags
|
||||||
object.emojis
|
object.emojis + object.tags
|
||||||
end
|
end
|
||||||
|
|
||||||
def virtual_attachments
|
def virtual_attachments
|
||||||
|
@ -119,6 +119,24 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
|
||||||
class CustomEmojiSerializer < ActivityPub::EmojiSerializer
|
class CustomEmojiSerializer < ActivityPub::EmojiSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class TagSerializer < ActiveModel::Serializer
|
||||||
|
include RoutingHelper
|
||||||
|
|
||||||
|
attributes :type, :href, :name
|
||||||
|
|
||||||
|
def type
|
||||||
|
'Hashtag'
|
||||||
|
end
|
||||||
|
|
||||||
|
def href
|
||||||
|
explore_hashtag_url(object)
|
||||||
|
end
|
||||||
|
|
||||||
|
def name
|
||||||
|
"##{object.name}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class Account::FieldSerializer < ActiveModel::Serializer
|
class Account::FieldSerializer < ActiveModel::Serializer
|
||||||
attributes :type, :name, :value
|
attributes :type, :name, :value
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue