about summary refs log tree commit diff
path: root/app/controllers/api/v1
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-07-20 03:58:14 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:44:01 -0500
commit3366a957219b15f5ab6f6eabbf5466e1e12082de (patch)
tree83397d725b7b93070137854e849a0afcc421f553 /app/controllers/api/v1
parent21438b54bdaf3c557ec9ebbc482a2c418d8c64f8 (diff)
[Feature] Add command tags; add #!edit and #!publish commands for mobile users
Diffstat (limited to 'app/controllers/api/v1')
-rw-r--r--app/controllers/api/v1/statuses/publishing_controller.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/app/controllers/api/v1/statuses/publishing_controller.rb b/app/controllers/api/v1/statuses/publishing_controller.rb
index 5124b1009..97c052e22 100644
--- a/app/controllers/api/v1/statuses/publishing_controller.rb
+++ b/app/controllers/api/v1/statuses/publishing_controller.rb
@@ -8,14 +8,7 @@ class Api::V1::Statuses::PublishingController < Api::BaseController
   before_action :set_status
 
   def create
-    @status.update!(published: true)
-
-    LinkCrawlWorker.perform_in(rand(1..30).seconds, @status.id) unless @status.spoiler_text?
-    DistributionWorker.perform_async(@status.id)
-    ActivityPub::DistributionWorker.perform_async(@status.id) if @status.local? && !@status.local_only?
-
-    mentions = @status.active_mentions.includes(:account).where(id: @new_mention_ids, accounts: { domain: nil })
-    mentions.each { |mention| LocalNotificationWorker.perform_async(mention.account.id, mention.id, mention.class.name) }
+    PublishStatusService.new.call(@status)
 
     render json: @status,
            serializer: (@status.is_a?(ScheduledStatus) ? REST::ScheduledStatusSerializer : REST::StatusSerializer),