mastodon/app/services/remove_featured_tag_service.rb
Takeshi Umeda 74ead7d106
Change featured tag updates to add/remove activity (#19409)
* 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
2022-10-22 18:30:55 +02:00

19 lines
453 B
Ruby

# frozen_string_literal: true
class RemoveFeaturedTagService < BaseService
include Payloadable
def call(account, featured_tag)
@account = account
featured_tag.destroy!
ActivityPub::AccountRawDistributionWorker.perform_async(build_json(featured_tag), account.id) if @account.local?
end
private
def build_json(featured_tag)
Oj.dump(serialize_payload(featured_tag, ActivityPub::RemoveSerializer, signer: @account))
end
end