about summary refs log tree commit diff
path: root/app/models/concerns
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/account_associations.rb3
-rw-r--r--app/models/concerns/status_threading_concern.rb3
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/concerns/account_associations.rb b/app/models/concerns/account_associations.rb
index a90104943..19190f0c5 100644
--- a/app/models/concerns/account_associations.rb
+++ b/app/models/concerns/account_associations.rb
@@ -61,5 +61,8 @@ module AccountAssociations
 
     # queued boosts
     has_many :queued_boosts, dependent: :destroy, inverse_of: :account
+
+    # kicked-out-of conversations
+    has_many :conversation_kicks, dependent: :destroy, inverse_of: :account
   end
 end
diff --git a/app/models/concerns/status_threading_concern.rb b/app/models/concerns/status_threading_concern.rb
index 1e5c52c46..adf8659d3 100644
--- a/app/models/concerns/status_threading_concern.rb
+++ b/app/models/concerns/status_threading_concern.rb
@@ -127,7 +127,8 @@ module StatusThreadingConcern
   end
 
   def statuses_with_accounts(ids)
-    Status.where(id: ids).includes(:account)
+    kicked_accounts = ConversationKick.select(:account_id).where(conversation_id: self.conversation_id)
+    Status.where(id: ids).where.not(account_id: kicked_accounts).includes(:account)
   end
 
   def filter_from_context?(status, account, relations)