forked from AkkomaGang/akkoma
Add visibility check in context path
This commit is contained in:
parent
e538102cf5
commit
e58f2240d3
1 changed files with 3 additions and 1 deletions
|
@ -384,11 +384,13 @@ def reblogged_by(%{assigns: %{user: user}} = conn, %{id: id}) do
|
||||||
def context(%{assigns: %{user: user}} = conn, %{id: id}) do
|
def context(%{assigns: %{user: user}} = conn, %{id: id}) do
|
||||||
with %Activity{} = activity <- Activity.get_by_id(id) do
|
with %Activity{} = activity <- Activity.get_by_id(id) do
|
||||||
activities =
|
activities =
|
||||||
ActivityPub.fetch_activities_for_context(activity.data["context"], %{
|
activity.data["context"]
|
||||||
|
|> ActivityPub.fetch_activities_for_context(%{
|
||||||
blocking_user: user,
|
blocking_user: user,
|
||||||
user: user,
|
user: user,
|
||||||
exclude_id: activity.id
|
exclude_id: activity.id
|
||||||
})
|
})
|
||||||
|
|> Enum.filter(fn activity -> Visibility.visible_for_user?(activity, user) end)
|
||||||
|
|
||||||
render(conn, "context.json", activity: activity, activities: activities, user: user)
|
render(conn, "context.json", activity: activity, activities: activities, user: user)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue