logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 1ad5cbed51831f4fad81aa9d8c0a3c6d8b200724
parent: c9e4c45e0e381eb0293588f65c49212e3573161a
Author: kaniini <nenolod@gmail.com>
Date:   Sun, 26 Aug 2018 22:39:15 +0000

Merge branch 'bugfix/common-api-visibility-orphan' into 'develop'

common api: properly handle replying to orphaned threads

See merge request pleroma/pleroma!299

Diffstat:

Mlib/pleroma/web/common_api/common_api.ex9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex @@ -61,8 +61,13 @@ defmodule Pleroma.Web.CommonAPI do do: visibility def get_visibility(%{"in_reply_to_status_id" => status_id}) when not is_nil(status_id) do - inReplyTo = get_replied_to_activity(status_id) - Pleroma.Web.MastodonAPI.StatusView.get_visibility(inReplyTo.data["object"]) + case get_replied_to_activity(status_id) do + nil -> + "public" + + inReplyTo -> + Pleroma.Web.MastodonAPI.StatusView.get_visibility(inReplyTo.data["object"]) + end end def get_visibility(_), do: "public"