diff options
Diffstat (limited to 'app/services/post_status_service.rb')
-rw-r--r-- | app/services/post_status_service.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index e7366c7e8..333bf88d8 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -47,7 +47,10 @@ class PostStatusService < BaseService private def preprocess_attributes! - @text = @options.delete(:spoiler_text) if @text.blank? && @options[:spoiler_text].present? + if @text.blank? && @options[:spoiler_text].present? + @text = '.' + @text = @media.find(&:video?) ? '📹' : '🖼' if @media.size > 0 + end @visibility = @options[:visibility] || @account.user&.setting_default_privacy @visibility = :unlisted if @visibility == :public && @account.silenced @scheduled_at = @options[:scheduled_at]&.to_datetime @@ -88,8 +91,12 @@ class PostStatusService < BaseService def postprocess_status! LinkCrawlWorker.perform_async(@status.id) unless @status.spoiler_text? DistributionWorker.perform_async(@status.id) - Pubsubhubbub::DistributionWorker.perform_async(@status.stream_entry.id) - ActivityPub::DistributionWorker.perform_async(@status.id) + + unless @status.local_only? + Pubsubhubbub::DistributionWorker.perform_async(@status.stream_entry.id) + ActivityPub::DistributionWorker.perform_async(@status.id) + end + PollExpirationNotifyWorker.perform_at(@status.poll.expires_at, @status.poll.id) if @status.poll end |