mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-20 08:30:59 +00:00
activitypub: add support for forwarding reports
This commit is contained in:
parent
3b48d5f0c2
commit
64b0120d67
1 changed files with 17 additions and 5 deletions
|
@ -370,20 +370,32 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
content: content
|
||||
} = params
|
||||
) do
|
||||
additional = params[:additional] || %{}
|
||||
|
||||
# only accept false as false value
|
||||
local = !(params[:local] == false)
|
||||
forward = !(params[:forward] == false)
|
||||
|
||||
%{
|
||||
additional = params[:additional] || %{}
|
||||
|
||||
params = %{
|
||||
actor: actor,
|
||||
context: context,
|
||||
account: account,
|
||||
statuses: statuses,
|
||||
content: content
|
||||
}
|
||||
|> make_flag_data(additional)
|
||||
|> insert(local)
|
||||
|
||||
additional =
|
||||
if forward do
|
||||
Map.merge(additional, %{"to" => [], "cc" => [account.ap_id]})
|
||||
else
|
||||
additional
|
||||
end
|
||||
|
||||
with flag_data <- make_flag_data(params, additional),
|
||||
{:ok, activity} <- insert(flag_data, local),
|
||||
:ok <- maybe_federate(activity) do
|
||||
{:ok, activity}
|
||||
end
|
||||
end
|
||||
|
||||
def fetch_activities_for_context(context, opts \\ %{}) do
|
||||
|
|
Loading…
Reference in a new issue