From 88c23ae91292815cd47583b6a841fac6489fb9df Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Wed, 24 Jul 2019 18:01:00 -0500 Subject: logger should not generate link cards or mentions for entries --- app/services/post_status_service.rb | 6 ++++-- app/workers/log_worker.rb | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'app') 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 -- cgit