[#1335] User: refactored :blocks field into :blocked_users relation.
Introduced UserBlock.
This commit is contained in:
parent
3a1aaadc18
commit
3db988250b
20 changed files with 234 additions and 69 deletions
|
|
@ -60,8 +60,10 @@ defmodule Pleroma.Notification do
|
|||
end
|
||||
|
||||
defp exclude_blocked(query, user) do
|
||||
blocked_ap_ids = User.blocked_ap_ids(user)
|
||||
|
||||
query
|
||||
|> where([n, a], a.actor not in ^user.blocks)
|
||||
|> where([n, a], a.actor not in ^blocked_ap_ids)
|
||||
|> where(
|
||||
[n, a],
|
||||
fragment("substring(? from '.*://([^/]*)')", a.actor) not in ^user.domain_blocks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue