Store status data inside flag activity
This commit is contained in:
parent
3b1bc079af
commit
90d516d42b
@ -609,9 +609,33 @@ defmodule Pleroma.Web.ActivityPub.Utils do
|
|||||||
defp build_flag_object(%{account: account, statuses: statuses} = _) do
|
defp build_flag_object(%{account: account, statuses: statuses} = _) do
|
||||||
[account.ap_id] ++
|
[account.ap_id] ++
|
||||||
Enum.map(statuses || [], fn
|
Enum.map(statuses || [], fn
|
||||||
%Activity{} = act -> act.data["id"]
|
%Activity{} = act ->
|
||||||
act when is_map(act) -> act["id"]
|
obj = Object.get_by_ap_id(act.data["object"])
|
||||||
act when is_binary(act) -> act
|
|
||||||
|
%{
|
||||||
|
"type" => "Note",
|
||||||
|
"id" => act.data["id"],
|
||||||
|
"content" => obj.data["content"]
|
||||||
|
}
|
||||||
|
|
||||||
|
act when is_map(act) ->
|
||||||
|
obj = Object.get_by_ap_id(act["object"])
|
||||||
|
|
||||||
|
%{
|
||||||
|
"type" => "Note",
|
||||||
|
"id" => act["id"],
|
||||||
|
"content" => obj.data["content"]
|
||||||
|
}
|
||||||
|
|
||||||
|
act
|
||||||
|
when is_binary(act) ->
|
||||||
|
activity = Activity.get_by_ap_id_with_object(act)
|
||||||
|
|
||||||
|
%{
|
||||||
|
"type" => "Note",
|
||||||
|
"id" => activity.data["id"],
|
||||||
|
"content" => activity.data["object"]["content"]
|
||||||
|
}
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user