From: feld Date: Mon, 25 Nov 2019 13:29:22 +0000 (+0000) Subject: Merge branch 'fix/update-reports-old-format' into 'develop' X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=9374b527569d9182773fe52209cdb86193dbf6a2;hp=756bdef5f5a879d6a817d833e7b9428f8c7b0c22;p=akkoma Merge branch 'fix/update-reports-old-format' into 'develop' Admin API: Fix error when trying to update reports in the "old" format See merge request pleroma/pleroma!1986 --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 8db8039b8..db6d45c61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Mastodon API: Fix private and direct statuses not being filtered out from the public timeline for an authenticated user (`GET /api/v1/timelines/public`) - Mastodon API: Inability to get some local users by nickname in `/api/v1/accounts/:id_or_nickname` +- Admin API: Error when trying to update reports in the "old" format ## [1.1.6] - 2019-11-19 diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex index c45662359..01aacbde3 100644 --- a/lib/pleroma/web/activity_pub/utils.ex +++ b/lib/pleroma/web/activity_pub/utils.ex @@ -903,7 +903,13 @@ defmodule Pleroma.Web.ActivityPub.Utils do def strip_report_status_data(activity) do [actor | reported_activities] = activity.data["object"] - stripped_activities = Enum.map(reported_activities, & &1["id"]) + + stripped_activities = + Enum.map(reported_activities, fn + act when is_map(act) -> act["id"] + act when is_binary(act) -> act + end) + new_data = put_in(activity.data, ["object"], [actor | stripped_activities]) {:ok, %{activity | data: new_data}}