diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-03-20 22:08:34 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-03-20 22:08:34 +0400 |
commit | 80e15716102e03323b117ade919035402cc7408f (patch) | |
tree | 60b57dde12b4feb693a6383b71f813561a48a928 /lib/pleroma/web/mastodon_api/controllers/account_controller.ex | |
parent | 5ad54d1bd556f3dc957aa1d2ebe6314618e75399 (diff) | |
parent | d74405fc1a27bb3d13f4ead2bc2369f23827a781 (diff) | |
download | pleroma-80e15716102e03323b117ade919035402cc7408f.tar.gz |
Merge branch 'develop' into global-status-expiration
Diffstat (limited to 'lib/pleroma/web/mastodon_api/controllers/account_controller.ex')
-rw-r--r-- | lib/pleroma/web/mastodon_api/controllers/account_controller.ex | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex index 88c997b9f..6dbf11ac9 100644 --- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex @@ -60,7 +60,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do plug( Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug - when action != :create + when action not in [:create, :show, :statuses] ) @relations [:follow, :unfollow] @@ -259,7 +259,8 @@ 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 + with %User{} = user <- User.get_cached_by_nickname_or_id(params["id"], for: reading_user), + true <- User.visible_for?(user, reading_user) do params = params |> Map.put("tag", params["tagged"]) @@ -271,6 +272,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do |> add_link_headers(activities) |> put_view(StatusView) |> render("index.json", activities: activities, for: reading_user, as: :activity) + else + _e -> render_error(conn, :not_found, "Can't find user") end end |