mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-09-11 20:57:44 +00:00
* Change featured tag updates to add/remove activity * Fix to check for the existence of feature tag * Rename service and worker * Merge AddHashtagSerializer with AddSerializer * Undo removal of sidekiq_options
26 lines
420 B
Ruby
26 lines
420 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ActivityPub::HashtagSerializer < ActivityPub::Serializer
|
|
context_extensions :hashtag
|
|
|
|
include RoutingHelper
|
|
|
|
attributes :type, :href, :name
|
|
|
|
def type
|
|
'Hashtag'
|
|
end
|
|
|
|
def name
|
|
"##{object.display_name}"
|
|
end
|
|
|
|
def href
|
|
if object.instance_of?(FeaturedTag)
|
|
short_account_tag_url(object.account, object.tag)
|
|
else
|
|
tag_url(object)
|
|
end
|
|
end
|
|
end
|