about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/services/post_status_service.rb6
-rw-r--r--app/workers/log_worker.rb2
2 files changed, 6 insertions, 2 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index c26f76a1b..b24ca02b3 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -30,6 +30,8 @@ class PostStatusService < BaseService
   # @option [String] :language
   # @option [String] :scheduled_at
   # @option [String] :delete_after
+  # @option [Boolean] :nocrawl Optional skip link card generation
+  # @option [Boolean] :nomentions Optional skip mention processing
   # @option [Hash] :poll Optional poll to attach
   # @option [Enumerable] :media_ids Optional array of media IDs to attach
   # @option [Doorkeeper::Application] :application
@@ -147,7 +149,7 @@ class PostStatusService < BaseService
     return false if @status.destroyed?
 
     process_hashtags_service.call(@status, @tags, @preloaded_tags)
-    process_mentions_service.call(@status)
+    process_mentions_service.call(@status) unless @options[:nomentions]
 
     return true
   end
@@ -170,7 +172,7 @@ class PostStatusService < BaseService
   end
 
   def postprocess_status!
-    LinkCrawlWorker.perform_async(@status.id) unless @status.spoiler_text?
+    LinkCrawlWorker.perform_async(@status.id) unless @options[:nocrawl] || @status.spoiler_text?
     DistributionWorker.perform_async(@status.id) unless @options[:distribute] == false
 
     unless @status.local_only? || @options[:distribute] == false || @options[:federate] == false
diff --git a/app/workers/log_worker.rb b/app/workers/log_worker.rb
index 556820e16..abeadefa6 100644
--- a/app/workers/log_worker.rb
+++ b/app/workers/log_worker.rb
@@ -21,6 +21,8 @@ class LogWorker
       local_only: true,
       content_type: 'text/plain',
       language: 'en',
+      nocrawl: true,
+      nomentions: true,
     )
   rescue ActiveRecord::RecordNotFound, ActiveRecord::RecordInvalid
     true