ActivityPub: Fix deletes being exempt from MRF

Closes #1461
This commit is contained in:
rinpatch 2019-12-05 02:50:38 +03:00
commit 9f99640cfc
7 changed files with 32 additions and 6 deletions

View file

@ -64,4 +64,12 @@ defmodule Pleroma.Activity.Queries do
where: fragment("(?)->>'type' = ?", activity.data, ^activity_type)
)
end
@spec exclude_type(query, String.t()) :: query
def exclude_type(query \\ Activity, activity_type) do
from(
activity in query,
where: fragment("(?)->>'type' != ?", activity.data, ^activity_type)
)
end
end