common api: handle replying to orphaned threads

This commit is contained in:
William Pitcock 2018-08-26 22:37:36 +00:00
parent 3448b434f5
commit 741c6ad671
1 changed files with 7 additions and 2 deletions

View File

@ -61,8 +61,13 @@ def get_visibility(%{"visibility" => visibility})
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"