activitypub: utils: rework make_flag_data to accept either activity payloads or IRIs

This commit is contained in:
William Pitcock 2019-03-14 19:04:52 +00:00
parent 414d4b8088
commit f86f7dbb8f

View file

@ -621,7 +621,12 @@ defmodule Pleroma.Web.ActivityPub.Utils do
#### Flag-related helpers #### Flag-related helpers
def make_flag_data(params, additional) do def make_flag_data(params, additional) do
status_ap_ids = Enum.map(params.statuses || [], & &1.data["id"]) status_ap_ids =
Enum.map(params.statuses || [], fn
act when is_map(act) -> act["id"]
act when is_binary(act) -> act
end)
object = [params.account.ap_id] ++ status_ap_ids object = [params.account.ap_id] ++ status_ap_ids
%{ %{