Browse Source

Filter out blocked/muted people from profile timelines (#7747)

Fix #7741
pull/4/head
Eugen Rochko 5 years ago
committed by GitHub
parent
commit
59b42188a7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/models/status.rb

+ 5
- 1
app/models/status.rb View File

@ -305,7 +305,11 @@ class Status < ApplicationRecord
# non-followers can see everything that isn't private/direct, but can see stuff they are mentioned in.
visibility.push(:private) if account.following?(target_account)
where(visibility: visibility).or(where(id: account.mentions.select(:status_id)))
scope = left_outer_joins(:reblog)
scope.where(visibility: visibility)
.or(scope.where(id: account.mentions.select(:status_id)))
.merge(scope.where(reblog_of_id: nil).or(scope.where.not(reblogs_statuses: { account_id: account.excluded_from_timeline_account_ids })))
end
end

Loading…
Cancel
Save