CommonAPI: Fail when user sends report with posts not visible to them

This commit is contained in:
Phantasm 2025-12-03 23:34:39 +01:00
commit 2b76243ec8
No known key found for this signature in database
GPG key ID: 2669E588BCC634C8
6 changed files with 124 additions and 3 deletions

View file

@ -147,7 +147,7 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
# TODO: Fix this quirk in FE and remove here and other affected places
with %Activity{} = activity <- Activity.get_by_id(id),
true <- Visibility.visible_for_user?(activity, draft.user),
{:type, type} when type in ["Create", "Announce"] <- {:type, activity.data["type"]} do
{_, type} when type in ["Create", "Announce"] <- {:type, activity.data["type"]} do
%__MODULE__{draft | in_reply_to: activity}
else
nil ->