Commit 1ad5cbed authored by kaniini's avatar kaniini

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

common api: properly handle replying to orphaned threads

See merge request pleroma/pleroma!299
parents c9e4c45e 741c6ad6
...@@ -61,8 +61,13 @@ def get_visibility(%{"visibility" => visibility}) ...@@ -61,8 +61,13 @@ def get_visibility(%{"visibility" => visibility})
do: visibility do: visibility
def get_visibility(%{"in_reply_to_status_id" => status_id}) when not is_nil(status_id) do def get_visibility(%{"in_reply_to_status_id" => status_id}) when not is_nil(status_id) do
inReplyTo = get_replied_to_activity(status_id) case get_replied_to_activity(status_id) do
Pleroma.Web.MastodonAPI.StatusView.get_visibility(inReplyTo.data["object"]) nil ->
"public"
inReplyTo ->
Pleroma.Web.MastodonAPI.StatusView.get_visibility(inReplyTo.data["object"])
end
end end
def get_visibility(_), do: "public" def get_visibility(_), do: "public"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment