Merge branch 'bugfix/1463-blocking-in-user-tls' into 'develop'
ActivityPub: For user timelines, respects blocks. Closes #1463 See merge request pleroma/pleroma!2041
This commit is contained in:
commit
29a3f70cba
3 changed files with 58 additions and 1 deletions
|
|
@ -749,6 +749,15 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
|> Map.put("whole_db", true)
|
||||
|> Map.put("pinned_activity_ids", user.pinned_activities)
|
||||
|
||||
params =
|
||||
if User.blocks?(reading_user, user) do
|
||||
params
|
||||
else
|
||||
params
|
||||
|> Map.put("blocking_user", reading_user)
|
||||
|> Map.put("muting_user", reading_user)
|
||||
end
|
||||
|
||||
recipients =
|
||||
user_activities_recipients(%{
|
||||
"godmode" => params["godmode"],
|
||||
|
|
|
|||
|
|
@ -249,7 +249,11 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
|
|||
@doc "GET /api/v1/accounts/:id/statuses"
|
||||
def statuses(%{assigns: %{user: reading_user}} = conn, params) do
|
||||
with %User{} = user <- User.get_cached_by_nickname_or_id(params["id"], for: reading_user) do
|
||||
params = Map.put(params, "tag", params["tagged"])
|
||||
params =
|
||||
params
|
||||
|> Map.put("tag", params["tagged"])
|
||||
|> Map.delete("godmode")
|
||||
|
||||
activities = ActivityPub.fetch_user_activities(user, reading_user, params)
|
||||
|
||||
conn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue