0
0
Fork 0

Add "clear notifications" button, exclude posts from people who have blocked *you* from public/hashtag timelines

This commit is contained in:
Eugen Rochko 2017-02-07 00:06:40 +01:00
parent c8252759df
commit ac035108aa
6 changed files with 54 additions and 3 deletions

View file

@ -161,7 +161,7 @@ class Status < ApplicationRecord
private
def filter_timeline(query, account)
blocked = Block.where(account: account).pluck(:target_account_id)
blocked = Block.where(account: account).pluck(:target_account_id) + Block.where(target_account: account).pluck(:account_id)
query = query.where('statuses.account_id NOT IN (?)', blocked) unless blocked.empty?
query = query.where('accounts.silenced = TRUE') if account.silenced?
query