diff options
Diffstat (limited to 'app/services/post_status_service.rb')
-rw-r--r-- | app/services/post_status_service.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index 300eae547..d7d7770e9 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -21,7 +21,10 @@ class PostStatusService < BaseService media = validate_media!(options[:media_ids]) status = nil - 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 ApplicationRecord.transaction do status = account.statuses.create!(text: text, @@ -39,9 +42,12 @@ class PostStatusService < BaseService 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) - ActivityPub::ReplyDistributionWorker.perform_async(status.id) if status.reply? && status.thread.account.local? + + unless status.local_only? + Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id) + ActivityPub::DistributionWorker.perform_async(status.id) + ActivityPub::ReplyDistributionWorker.perform_async(status.id) if status.reply? && status.thread.account.local? + end if options[:idempotency].present? redis.setex("idempotency:status:#{account.id}:#{options[:idempotency]}", 3_600, status.id) |