Require related object for notifications to filter on content

This commit is contained in:
Alexander Tumin 2023-02-07 15:30:07 +03:00 committed by tusooa
commit c3a0703564
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
2 changed files with 28 additions and 0 deletions

View file

@ -178,6 +178,7 @@ defmodule Pleroma.Notification do
from([_n, a, o] in query,
where:
fragment("not(?->>'content' ~* ?)", o.data, ^regex) or
fragment("?->>'content' is null", o.data) or
fragment("?->>'actor' = ?", o.data, ^user.ap_id)
)
end