projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'update/adminfe-20200331' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
controllers
/
status_controller.ex
diff --git
a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
index b0048102fd2bccf92e95b7b3cc5906ff40870b79..37afe6949f29f1e116beb5f6c1d88fdf3c19852f 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/controllers/status_controller.ex
+++ b/
lib/pleroma/web/mastodon_api/controllers/status_controller.ex
@@
-76,7
+76,7
@@
defmodule Pleroma.Web.MastodonAPI.StatusController do
%{scopes: ["write:bookmarks"]} when action in [:bookmark, :unbookmark]
)
%{scopes: ["write:bookmarks"]} when action in [:bookmark, :unbookmark]
)
- plug(Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug)
+ plug(Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
when action not in [:index, :show]
)
@rate_limited_status_actions ~w(reblog unreblog favourite unfavourite create delete)a
@rate_limited_status_actions ~w(reblog unreblog favourite unfavourite create delete)a
@@
-175,6
+175,8
@@
defmodule Pleroma.Web.MastodonAPI.StatusController do
for: user,
with_direct_conversation_id: true
)
for: user,
with_direct_conversation_id: true
)
+ else
+ _ -> {:error, :not_found}
end
end
end
end
@@
-183,6
+185,7
@@
defmodule Pleroma.Web.MastodonAPI.StatusController do
with {:ok, %Activity{}} <- CommonAPI.delete(id, user) do
json(conn, %{})
else
with {:ok, %Activity{}} <- CommonAPI.delete(id, user) do
json(conn, %{})
else
+ {:error, :not_found} = e -> e
_e -> render_error(conn, :forbidden, "Can't delete this post")
end
end
_e -> render_error(conn, :forbidden, "Can't delete this post")
end
end