diff options
author | Mark Felder <feld@feld.me> | 2022-11-12 17:52:37 -0500 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2022-11-12 17:54:11 -0500 |
commit | 749445dd50ba9376779c902584da3b55be7270bb (patch) | |
tree | 0b9c8ac17e31704a313bbccd18c8df7eaa04107d | |
parent | 4d321be05c0aa34921f96f38c17dd611691f3c44 (diff) | |
download | pleroma-749445dd50ba9376779c902584da3b55be7270bb.tar.gz pleroma-749445dd50ba9376779c902584da3b55be7270bb.zip |
Fix reports which do not have a user
The check for deactivated users was being applied to report activities.
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 5099caef7..ad9eb2505 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -1239,6 +1239,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do end end + defp exclude_invisible_actors(query, %{type: "Flag"}), do: query defp exclude_invisible_actors(query, %{invisible_actors: true}), do: query defp exclude_invisible_actors(query, _opts) do @@ -1377,7 +1378,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do |> restrict_instance(opts) |> restrict_announce_object_actor(opts) |> restrict_filtered(opts) - |> Activity.restrict_deactivated_users() + |> maybe_restrict_deactivated_users(opts) |> exclude_poll_votes(opts) |> exclude_chat_messages(opts) |> exclude_invisible_actors(opts) @@ -1789,4 +1790,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do |> restrict_visibility(%{visibility: "direct"}) |> order_by([activity], asc: activity.id) end + + defp maybe_restrict_deactivated_users(activity, %{type: "Flag"}), do: activity + + defp maybe_restrict_deactivated_users(activity, _opts), + do: Activity.restrict_deactivated_users(activity) end |