Skip to content

Commit

Permalink
Add account hashtags to ActivityPub actor JSON (mastodon#9450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and hiyuki2578 committed Oct 2, 2019
1 parent 2d7b883 commit 903c13c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion app/serializers/activitypub/actor_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def is_cat
end

def virtual_tags
object.emojis
object.emojis + object.tags
end

def virtual_attachments
Expand All @@ -123,6 +123,24 @@ def moved_to
class CustomEmojiSerializer < ActivityPub::EmojiSerializer
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
attributes :type, :name, :value

Expand Down

0 comments on commit 903c13c

Please sign in to comment.