Prevent remote access of local-only posts via /objects
Ref: fix-local-public
This commit is contained in:
parent
466568ae36
commit
fe933b9bf2
2 changed files with 25 additions and 1 deletions
|
|
@ -84,7 +84,10 @@ defmodule Pleroma.Web.ActivityPub.Visibility do
|
|||
when module in [Activity, Object] do
|
||||
x = [user.ap_id | User.following(user)]
|
||||
y = [message.data["actor"]] ++ message.data["to"] ++ (message.data["cc"] || [])
|
||||
is_public?(message) || Enum.any?(x, &(&1 in y))
|
||||
|
||||
user_is_local = user.local
|
||||
federatable = not is_local_public?(message)
|
||||
(is_public?(message) || Enum.any?(x, &(&1 in y))) and (user_is_local || federatable)
|
||||
end
|
||||
|
||||
def entire_thread_visible_for_user?(%Activity{} = activity, %User{} = user) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue