forked from AkkomaGang/akkoma
activitypub: utils: rework make_flag_data to accept either activity payloads or IRIs
This commit is contained in:
parent
414d4b8088
commit
f86f7dbb8f
1 changed files with 6 additions and 1 deletions
|
@ -621,7 +621,12 @@ def make_create_data(params, additional) 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
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
|
Loading…
Reference in a new issue