about summary refs log tree commit diff
path: root/app/controllers/api/v1/statuses/bookmarks_controller.rb
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-09-20 22:52:50 -0500
committerFire Demon <firedemon@creature.cafe>2020-09-20 23:07:30 -0500
commit64694de343737360e797a92a0a6c0e88695facda (patch)
treee31a8d7eb5cb909be89df96e8185b20183ed5a22 /app/controllers/api/v1/statuses/bookmarks_controller.rb
parente3cb18ba7520997a0f605c7f90db258ccccd5e33 (diff)
Monsterfork v1-style curated Federated timeline
Diffstat (limited to 'app/controllers/api/v1/statuses/bookmarks_controller.rb')
-rw-r--r--app/controllers/api/v1/statuses/bookmarks_controller.rb6
1 files changed, 6 insertions, 0 deletions
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