cleaner ecto query to handle restrict_unauthenticated for activities

This fix is for this case:

  config :pleroma, :restrict_unauthenticated,
    activities: %{local: true, remote: true}
This commit is contained in:
Faried Nawaz 2023-02-10 01:32:32 +05:00 committed by faried nawaz
parent dc4de79d43
commit e5e76ec445
1 changed files with 1 additions and 2 deletions

View File

@ -1222,8 +1222,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
cond do
local and remote ->
# is there a better way to handle this?
from(activity in query, where: 1 == 0)
from(activity in query, where: false)
local ->
from(activity in query, where: activity.local == false)