summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreugenijm <eugenijm@protonmail.com>2020-03-02 16:47:30 +0300
committereugenijm <eugenijm@protonmail.com>2020-03-02 16:47:31 +0300
commit7af431c150cf4dc2c283b6a90fdaa7eafd860170 (patch)
treee249d9fc45e19a206f52173a4c35e76482da6e10
parent45b08ca1665920564c9daf35a96e93dff031a649 (diff)
Exclude reblogs from `GET /api/pleroma/admin/statuses` by default
-rw-r--r--docs/API/admin_api.md13
-rw-r--r--lib/pleroma/web/admin_api/admin_api_controller.ex4
2 files changed, 16 insertions, 1 deletions
diff --git a/docs/API/admin_api.md b/docs/API/admin_api.md
index 91c76ce00..47afdfba5 100644
--- a/docs/API/admin_api.md
+++ b/docs/API/admin_api.md
@@ -278,6 +278,19 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- On failure: `Not found`
- On success: JSON array of instance's latest statuses
+## `GET /api/pleroma/admin/statuses`
+
+### Retrives all latest statuses
+
+- Params:
+ - *optional* `page_size`: number of statuses to return (default is `20`)
+ - *optional* `local_only`: excludes remote statuses
+ - *optional* `godmode`: `true`/`false` – allows to see private statuses
+ - *optional* `with_reblogs`: `true`/`false` – allows to see reblogs (default is false)
+- Response:
+ - On failure: `Not found`
+ - On success: JSON array of user's latest statuses
+
## `POST /api/pleroma/admin/relay`
### Follow a Relay
diff --git a/lib/pleroma/web/admin_api/admin_api_controller.ex b/lib/pleroma/web/admin_api/admin_api_controller.ex
index 558832703..de0755ee5 100644
--- a/lib/pleroma/web/admin_api/admin_api_controller.ex
+++ b/lib/pleroma/web/admin_api/admin_api_controller.ex
@@ -748,6 +748,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
def list_statuses(%{assigns: %{user: admin}} = conn, params) do
godmode = params["godmode"] == "true" || params["godmode"] == true
local_only = params["local_only"] == "true" || params["local_only"] == true
+ with_reblogs = params["with_reblogs"] == "true" || params["with_reblogs"] == true
{page, page_size} = page_params(params)
activities =
@@ -755,7 +756,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
"godmode" => godmode,
"local_only" => local_only,
"limit" => page_size,
- "offset" => (page - 1) * page_size
+ "offset" => (page - 1) * page_size,
+ "exclude_reblogs" => !with_reblogs && "true"
})
conn