aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_api_controller.ex18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
index d660f3f05..ccebcd415 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
@@ -884,9 +884,12 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
%Object{data: %{"likes" => likes}} <- Object.normalize(object) do
q = from(u in User, where: u.ap_id in ^likes)
- users =
- Repo.all(q)
- |> Enum.filter(&(not User.blocks?(user, &1)))
+ users = Repo.all(q)
+ users = if is_nil(user) do
+ users
+ else
+ Enum.filter(users, &(not User.blocks?(user, &1)))
+ end
conn
|> put_view(AccountView)
@@ -901,9 +904,12 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
%Object{data: %{"announcements" => announces}} <- Object.normalize(object) do
q = from(u in User, where: u.ap_id in ^announces)
- users =
- Repo.all(q)
- |> Enum.filter(&(not User.blocks?(user, &1)))
+ users = Repo.all(q)
+ users = if is_nil(user) do
+ users
+ else
+ Enum.filter(users, &(not User.blocks?(user, &1)))
+ end
conn
|> put_view(AccountView)