about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/services/process_mentions_service.rb4
-rw-r--r--app/workers/post_status_worker.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/app/services/process_mentions_service.rb b/app/services/process_mentions_service.rb
index ac39464fb..da29fd639 100644
--- a/app/services/process_mentions_service.rb
+++ b/app/services/process_mentions_service.rb
@@ -8,7 +8,7 @@ class ProcessMentionsService < BaseService
   # remote users
   # @param [Status] status
   def call(status, skip_process: false, skip_notify: false)
-    return if status.hidden || !status.local? || status.draft?
+    return if !status.local? || status.draft?
 
     @status  = status
     mentions = Mention.where(status: status).to_a
@@ -38,7 +38,7 @@ class ProcessMentionsService < BaseService
       status.save!
     end
 
-    return if skip_notify
+    return if skip_notify || status.hidden?
     mentions.uniq.each { |mention| create_notification(mention) }
   end
 
diff --git a/app/workers/post_status_worker.rb b/app/workers/post_status_worker.rb
index ac3aef1fe..cdce28047 100644
--- a/app/workers/post_status_worker.rb
+++ b/app/workers/post_status_worker.rb
@@ -12,7 +12,9 @@ class PostStatusWorker
     status.update!(options.slice(:visibility, :local_only, :reject_replies, :hidden).compact)
     status.reload
 
-    process_mentions_service.call(status, skip_process: options[:process_mentions] != true) unless options[:nomentions] || status.hidden
+    Rails.cache.delete("statuses/#{status.id}")
+
+    process_mentions_service.call(status, skip_process: (options[:process_mentions] != true)) unless options[:nomentions]
 
     LinkCrawlWorker.perform_async(status.id) unless options[:nocrawl] || status.spoiler_text.present?
     DistributionWorker.perform_async(status.id) unless options[:distribute] == false
@@ -23,8 +25,6 @@ class PostStatusWorker
 
     PollExpirationNotifyWorker.perform_at(status.poll.expires_at, status.poll.id) if status.poll
 
-    Rails.cache.delete("statuses/#{status.id}")
-
     return true if !status.reply? || status.account.id == status.in_reply_to_account_id || status.hidden
     ActivityTracker.increment('activity:interactions')
     return if status.account.following?(status.in_reply_to_account_id)