From: William Pitcock Date: Thu, 14 Mar 2019 19:04:52 +0000 (+0000) Subject: activitypub: utils: rework make_flag_data to accept either activity payloads or IRIs X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=f86f7dbb8f7bd72bd4037b03224b2840de4a4292;p=akkoma activitypub: utils: rework make_flag_data to accept either activity payloads or IRIs --- diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex index 182f9cacb..9881b7bbb 100644 --- a/lib/pleroma/web/activity_pub/utils.ex +++ b/lib/pleroma/web/activity_pub/utils.ex @@ -621,7 +621,12 @@ defmodule Pleroma.Web.ActivityPub.Utils do #### Flag-related helpers 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 %{