From 74ead7d10698c7f18ca22c07d2f04ff81f419097 Mon Sep 17 00:00:00 2001 From: Takeshi Umeda Date: Sun, 23 Oct 2022 01:30:55 +0900 Subject: 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 --- app/services/remove_featured_tag_service.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/services/remove_featured_tag_service.rb (limited to 'app/services/remove_featured_tag_service.rb') diff --git a/app/services/remove_featured_tag_service.rb b/app/services/remove_featured_tag_service.rb new file mode 100644 index 000000000..2aa70e8fc --- /dev/null +++ b/app/services/remove_featured_tag_service.rb @@ -0,0 +1,18 @@ +# 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 -- cgit