From 21438b54bdaf3c557ec9ebbc482a2c418d8c64f8 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Sun, 19 Jul 2020 18:50:24 -0500 Subject: [Feature] Add manual publishing option --- app/services/update_status_service.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/services/update_status_service.rb') diff --git a/app/services/update_status_service.rb b/app/services/update_status_service.rb index b393f13bb..440b99ce7 100644 --- a/app/services/update_status_service.rb +++ b/app/services/update_status_service.rb @@ -32,7 +32,8 @@ class UpdateStatusService < BaseService @tags = (tags.nil? ? @status.tags : (tags || [])).to_set @params[:text] ||= '' - @params[:edited] ||= 1 + @status.edited + @params[:published] = true if @status.published? + (@params[:edited] ||= 1 + @status.edited) if @params[:published].presence || @status.published? update_tags if @status.local? filter_tags @@ -54,7 +55,7 @@ class UpdateStatusService < BaseService prune_attachments reset_status_caches - SpamCheck.perform(@status) + SpamCheck.perform(@status) if @status.published? distribute @status @@ -132,6 +133,9 @@ class UpdateStatusService < BaseService def distribute LinkCrawlWorker.perform_in(rand(1..30).seconds, @status.id) unless @status.spoiler_text? DistributionWorker.perform_async(@status.id) + + return unless @status.published? + 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 }) -- cgit