From 876b6dbf766372303ad5f646fdcba4dccde47ca4 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Thu, 26 Nov 2020 11:33:14 -0600 Subject: Revert 5c4a7ea666, keep old Tavern curation behavior --- app/controllers/api/v1/statuses/bookmarks_controller.rb | 6 ++++++ app/services/favourite_service.rb | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/controllers/api/v1/statuses/bookmarks_controller.rb b/app/controllers/api/v1/statuses/bookmarks_controller.rb index 19963c002..1bf698a78 100644 --- a/app/controllers/api/v1/statuses/bookmarks_controller.rb +++ b/app/controllers/api/v1/statuses/bookmarks_controller.rb @@ -9,6 +9,7 @@ class Api::V1::Statuses::BookmarksController < Api::BaseController def create current_account.bookmarks.find_or_create_by!(account: current_account, status: @status) + curate! unless @status.curated? || !@status.published? render json: @status, serializer: REST::StatusSerializer end @@ -37,4 +38,9 @@ class Api::V1::Statuses::BookmarksController < Api::BaseController rescue Mastodon::NotPermittedError not_found end + + def curate! + @status.curate! + DistributionWorker.perform_async(@status.id) + end end diff --git a/app/services/favourite_service.rb b/app/services/favourite_service.rb index a0ab3b4b7..f3e89746b 100644 --- a/app/services/favourite_service.rb +++ b/app/services/favourite_service.rb @@ -16,6 +16,7 @@ class FavouriteService < BaseService return favourite unless favourite.nil? favourite = Favourite.create!(account: account, status: status) + curate!(status) unless status.curated? || !status.published? create_notification(favourite) bump_potential_friendship(account, status) @@ -44,4 +45,9 @@ class FavouriteService < BaseService def build_json(favourite) Oj.dump(serialize_payload(favourite, ActivityPub::LikeSerializer)) end + + def curate!(status) + status.curate! + DistributionWorker.perform_async(status.id) + end end -- cgit