From d6b266163b9161bf28df7919ffd1391c81b142e3 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 25 Nov 2018 18:57:38 +0000 Subject: [PATCH] common api: fetch visibility from normalized object --- lib/pleroma/web/common_api/common_api.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index e3385310f..e0c9dedd5 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -64,7 +64,10 @@ def get_visibility(%{"in_reply_to_status_id" => status_id}) when not is_nil(stat "public" inReplyTo -> - Pleroma.Web.MastodonAPI.StatusView.get_visibility(inReplyTo.data["object"]) + # XXX: these heuristics should be moved out of MastodonAPI. + with %Object{} = object <- Object.normalize(inReplyTo.data["object"]) do + Pleroma.Web.MastodonAPI.StatusView.get_visibility(object.data) + end end end