about summary refs log tree commit diff
path: root/app/models/status.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-12-23 14:33:47 +0100
committerGitHub <noreply@github.com>2020-12-23 14:33:47 +0100
commit225c934a1b66e2fcbedbda7936666c1ca3c9a04b (patch)
treed71a57d5f5b6bd864ec11cc1c914a6c3b30ba612 /app/models/status.rb
parent81f4c550b2ed305f39f344d10289b38625f70bf7 (diff)
parent537afa00f35dbaa98cbff284683317b411104a82 (diff)
Merge pull request #1481 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/status.rb')
-rw-r--r--app/models/status.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index d1ac2e4f2..0d15304b6 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -234,14 +234,6 @@ class Status < ApplicationRecord
     @emojis = CustomEmoji.from_text(fields.join(' '), account.domain)
   end
 
-  def mark_for_mass_destruction!
-    @marked_for_mass_destruction = true
-  end
-
-  def marked_for_mass_destruction?
-    @marked_for_mass_destruction
-  end
-
   def replies_count
     status_stat&.replies_count || 0
   end
@@ -498,7 +490,7 @@ class Status < ApplicationRecord
   end
 
   def decrement_counter_caches
-    return if direct_visibility? || marked_for_mass_destruction?
+    return if direct_visibility?
 
     account&.decrement_count!(:statuses_count)
     reblog&.decrement_count!(:reblogs_count) if reblog?
@@ -508,7 +500,7 @@ class Status < ApplicationRecord
   def unlink_from_conversations
     return unless direct_visibility?
 
-    mentioned_accounts = mentions.includes(:account).map(&:account)
+    mentioned_accounts = (association(:mentions).loaded? ? mentions : mentions.includes(:account)).map(&:account)
     inbox_owners       = mentioned_accounts.select(&:local?) + (account.local? ? [account] : [])
 
     inbox_owners.each do |inbox_owner|