Allow authenticated users to access local-only posts in MastoAPI
Ref: fix-local-public
This commit is contained in:
parent
fe933b9bf2
commit
38444aa92a
3 changed files with 168 additions and 3 deletions
|
|
@ -612,9 +612,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
do: query
|
||||
|
||||
defp restrict_thread_visibility(query, %{user: %User{ap_id: ap_id}}, _) do
|
||||
local_public = as_local_public()
|
||||
from(
|
||||
a in query,
|
||||
where: fragment("thread_visibility(?, (?)->>'id') = true", ^ap_id, a.data)
|
||||
where: fragment("thread_visibility(?, (?)->>'id', ?) = true", ^ap_id, a.data, ^local_public)
|
||||
)
|
||||
end
|
||||
|
||||
|
|
@ -701,8 +702,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
defp user_activities_recipients(%{godmode: true}), do: []
|
||||
|
||||
defp user_activities_recipients(%{reading_user: reading_user}) do
|
||||
if reading_user do
|
||||
[Constants.as_public(), reading_user.ap_id | User.following(reading_user)]
|
||||
if not is_nil(reading_user) and reading_user.local do
|
||||
[Constants.as_public(), as_local_public(), reading_user.ap_id | User.following(reading_user)]
|
||||
else
|
||||
[Constants.as_public()]
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue