diff --git a/CHANGELOG.md b/CHANGELOG.md
index 08bb7e1c7..12f7e8fab 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -104,6 +104,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Configuration: `feed` option for user atom feed.
- Pleroma API: Add Emoji reactions
- Admin API: Add `/api/pleroma/admin/instances/:instance/statuses` - lists all statuses from a given instance
+- Admin API: Add `/api/pleroma/admin/users/:nickname/statuses` - lists all statuses from a given user
- Admin API: `PATCH /api/pleroma/users/confirm_email` to confirm email for multiple users, `PATCH /api/pleroma/users/resend_confirmation_email` to resend confirmation email for multiple users
- ActivityPub: Configurable `type` field of the actors.
- Mastodon API: `/api/v1/accounts/:id` has `source/pleroma/actor_type` field.
@@ -121,6 +122,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Pleroma API: Add reactions for a single emoji.
- ActivityPub: `[:activitypub, :note_replies_output_limit]` setting sets the number of note self-replies to output on outgoing federation.
- Admin API: `GET /api/pleroma/admin/stats` to get status count by visibility scope
+- Admin API: `GET /api/pleroma/admin/statuses` - list all statuses (accepts `godmode` and `local_only`)
### Fixed
diff --git a/config/config.exs b/config/config.exs
index 9d1e29c0d..0dde1fc85 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -402,6 +402,8 @@
config :phoenix, :json_library, Jason
+config :phoenix, :filter_parameters, ["password", "confirm"]
+
config :pleroma, :gopher,
enabled: false,
ip: {0, 0, 0, 0},
diff --git a/config/description.exs b/config/description.exs
index f0d1077fd..aa8a8d790 100644
--- a/config/description.exs
+++ b/config/description.exs
@@ -1615,160 +1615,6 @@
}
]
},
- %{
- group: :pleroma,
- key: Pleroma.Web.Endpoint,
- type: :group,
- description: "Phoenix endpoint configuration",
- children: [
- %{
- key: :http,
- label: "HTTP",
- type: {:keyword, :integer, :tuple},
- description: "http protocol configuration",
- suggestions: [
- port: 8080,
- ip: {127, 0, 0, 1}
- ],
- children: [
- %{
- key: :dispatch,
- type: {:list, :tuple},
- description: "dispatch settings",
- suggestions: [
- {:_,
- [
- {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
- {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
- {Phoenix.Transports.WebSocket,
- {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
- {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
- ]}
- # end copied from config.exs
- ]
- },
- %{
- key: :ip,
- label: "IP",
- type: :tuple,
- description: "ip",
- suggestions: [
- {0, 0, 0, 0}
- ]
- },
- %{
- key: :port,
- type: :integer,
- description: "port",
- suggestions: [
- 2020
- ]
- }
- ]
- },
- %{
- key: :url,
- label: "URL",
- type: {:keyword, :string, :integer},
- description: "configuration for generating urls",
- suggestions: [
- host: "example.com",
- port: 2020,
- scheme: "https"
- ],
- children: [
- %{
- key: :host,
- type: :string,
- description: "Host",
- suggestions: [
- "example.com"
- ]
- },
- %{
- key: :port,
- type: :integer,
- description: "port",
- suggestions: [
- 2020
- ]
- },
- %{
- key: :scheme,
- type: :string,
- description: "Scheme",
- suggestions: [
- "https",
- "https"
- ]
- }
- ]
- },
- %{
- key: :instrumenters,
- type: {:list, :module},
- suggestions: [Pleroma.Web.Endpoint.Instrumenter]
- },
- %{
- key: :protocol,
- type: :string,
- suggestions: ["https"]
- },
- %{
- key: :secret_key_base,
- type: :string,
- suggestions: ["aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl"]
- },
- %{
- key: :signing_salt,
- type: :string,
- suggestions: ["CqaoopA2"]
- },
- %{
- key: :render_errors,
- type: :keyword,
- suggestions: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
- children: [
- %{
- key: :view,
- type: :module,
- suggestions: [Pleroma.Web.ErrorView]
- },
- %{
- key: :accepts,
- type: {:list, :string},
- suggestions: ["json"]
- }
- ]
- },
- %{
- key: :pubsub,
- type: :keyword,
- suggestions: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
- children: [
- %{
- key: :name,
- type: :module,
- suggestions: [Pleroma.PubSub]
- },
- %{
- key: :adapter,
- type: :module,
- suggestions: [Phoenix.PubSub.PG2]
- }
- ]
- },
- %{
- key: :secure_cookie_flag,
- type: :boolean
- },
- %{
- key: :extra_cookie_attrs,
- type: {:list, :string},
- suggestions: ["SameSite=Lax"]
- }
- ]
- },
%{
group: :pleroma,
key: :activitypub,
@@ -2594,19 +2440,6 @@
}
]
},
- %{
- group: :pleroma,
- key: :database,
- type: :group,
- description: "Database related settings",
- children: [
- %{
- key: :rum_enabled,
- type: :boolean,
- description: "If RUM indexes should be used. Default: disabled"
- }
- ]
- },
%{
group: :pleroma,
key: :rate_limit,
@@ -2770,20 +2603,6 @@
}
]
},
- %{
- group: :prometheus,
- key: Pleroma.Web.Endpoint.MetricsExporter,
- type: :group,
- description: "Prometheus settings",
- children: [
- %{
- key: :path,
- type: :string,
- description: "API endpoint with metrics",
- suggestions: ["/api/pleroma/app_metrics"]
- }
- ]
- },
%{
group: :http_signatures,
type: :group,
@@ -3051,7 +2870,7 @@
group: :pleroma,
key: :feed,
type: :group,
- description: "Configure feed rendering.",
+ description: "Configure feed rendering",
children: [
%{
key: :post_title,
@@ -3101,7 +2920,7 @@
group: :pleroma,
key: :modules,
type: :group,
- description: "Custom Runtime Modules.",
+ description: "Custom Runtime Modules",
children: [
%{
key: :runtime_dir,
@@ -3109,18 +2928,5 @@
description: "A path to custom Elixir modules (such as MRF policies)."
}
]
- },
- %{
- group: :pleroma,
- type: :group,
- description: "Allow instance configuration from database.",
- children: [
- %{
- key: :configurable_from_database,
- type: :boolean,
- description:
- "Allow transferring configuration to DB with the subsequent customization from Admin api. Default: disabled"
- }
- ]
}
]
diff --git a/docs/API/admin_api.md b/docs/API/admin_api.md
index 3882763cd..91c76ce00 100644
--- a/docs/API/admin_api.md
+++ b/docs/API/admin_api.md
@@ -260,10 +260,24 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- `nickname` or `id`
- *optional* `page_size`: number of statuses to return (default is `20`)
- *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
+## `GET /api/pleroma/admin/instances/:instance/statuses`
+
+### Retrive instance's latest statuses
+
+- Params:
+ - `instance`: instance name
+ - *optional* `page_size`: number of statuses to return (default is `20`)
+ - *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 instance's latest statuses
+
## `POST /api/pleroma/admin/relay`
### Follow a Relay
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index 5c436941a..12695b3f9 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -770,13 +770,18 @@ def fetch_user_activities(user, reading_user, params \\ %{}) do
|> Enum.reverse()
end
- def fetch_instance_activities(params) do
+ def fetch_statuses(reading_user, params) do
params =
params
|> Map.put("type", ["Create", "Announce"])
- |> Map.put("instance", params["instance"])
- fetch_activities([Pleroma.Constants.as_public()], params, :offset)
+ recipients =
+ user_activities_recipients(%{
+ "godmode" => params["godmode"],
+ "reading_user" => reading_user
+ })
+
+ fetch_activities(recipients, params, :offset)
|> Enum.reverse()
end
diff --git a/lib/pleroma/web/admin_api/admin_api_controller.ex b/lib/pleroma/web/admin_api/admin_api_controller.ex
index 816b8938c..8804343b9 100644
--- a/lib/pleroma/web/admin_api/admin_api_controller.ex
+++ b/lib/pleroma/web/admin_api/admin_api_controller.ex
@@ -244,13 +244,15 @@ def user_show(conn, %{"nickname" => nickname}) do
end
def list_instance_statuses(conn, %{"instance" => instance} = params) do
+ with_reblogs = params["with_reblogs"] == "true" || params["with_reblogs"] == true
{page, page_size} = page_params(params)
activities =
- ActivityPub.fetch_instance_activities(%{
+ ActivityPub.fetch_statuses(nil, %{
"instance" => instance,
"limit" => page_size,
- "offset" => (page - 1) * page_size
+ "offset" => (page - 1) * page_size,
+ "exclude_reblogs" => !with_reblogs && "true"
})
conn
@@ -259,6 +261,7 @@ def list_instance_statuses(conn, %{"instance" => instance} = params) do
end
def list_user_statuses(conn, %{"nickname" => nickname} = params) do
+ with_reblogs = params["with_reblogs"] == "true" || params["with_reblogs"] == true
godmode = params["godmode"] == "true" || params["godmode"] == true
with %User{} = user <- User.get_cached_by_nickname_or_id(nickname) do
@@ -267,7 +270,8 @@ def list_user_statuses(conn, %{"nickname" => nickname} = params) do
activities =
ActivityPub.fetch_user_activities(user, nil, %{
"limit" => page_size,
- "godmode" => godmode
+ "godmode" => godmode,
+ "exclude_reblogs" => !with_reblogs && "true"
})
conn
@@ -741,6 +745,24 @@ def report_notes_delete(%{assigns: %{user: user}} = conn, %{
end
end
+ 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
+ {page, page_size} = page_params(params)
+
+ activities =
+ ActivityPub.fetch_statuses(admin, %{
+ "godmode" => godmode,
+ "local_only" => local_only,
+ "limit" => page_size,
+ "offset" => (page - 1) * page_size
+ })
+
+ conn
+ |> put_view(Pleroma.Web.AdminAPI.StatusView)
+ |> render("index.json", %{activities: activities, as: :activity})
+ end
+
def status_update(%{assigns: %{user: admin}} = conn, %{"id" => id} = params) do
with {:ok, activity} <- CommonAPI.update_activity_scope(id, params) do
{:ok, sensitive} = Ecto.Type.cast(:boolean, params["sensitive"])
diff --git a/lib/pleroma/web/admin_api/views/status_view.ex b/lib/pleroma/web/admin_api/views/status_view.ex
index 6f2b2b09c..8ae8a7afe 100644
--- a/lib/pleroma/web/admin_api/views/status_view.ex
+++ b/lib/pleroma/web/admin_api/views/status_view.ex
@@ -10,7 +10,7 @@ defmodule Pleroma.Web.AdminAPI.StatusView do
alias Pleroma.User
def render("index.json", opts) do
- render_many(opts.activities, __MODULE__, "show.json", opts)
+ safe_render_many(opts.activities, __MODULE__, "show.json", opts)
end
def render("show.json", %{activity: %{data: %{"object" => _object}} = activity} = opts) do
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex
index c2ffb025a..103c638b4 100644
--- a/lib/pleroma/web/router.ex
+++ b/lib/pleroma/web/router.ex
@@ -192,6 +192,7 @@ defmodule Pleroma.Web.Router do
put("/statuses/:id", AdminAPIController, :status_update)
delete("/statuses/:id", AdminAPIController, :status_delete)
+ get("/statuses", AdminAPIController, :list_statuses)
get("/config", AdminAPIController, :config_show)
post("/config", AdminAPIController, :config_update)
diff --git a/priv/static/adminfe/chunk-03b0.b69ddaf0.css b/priv/static/adminfe/chunk-03b0.49362218.css
similarity index 100%
rename from priv/static/adminfe/chunk-03b0.b69ddaf0.css
rename to priv/static/adminfe/chunk-03b0.49362218.css
diff --git a/priv/static/adminfe/chunk-06de.3abb5de7.css b/priv/static/adminfe/chunk-06de.3abb5de7.css
deleted file mode 100644
index 4fb60b648..000000000
Binary files a/priv/static/adminfe/chunk-06de.3abb5de7.css and /dev/null differ
diff --git a/priv/static/adminfe/chunk-15fa.86ad6a40.css b/priv/static/adminfe/chunk-15fa.dc3643e6.css
similarity index 100%
rename from priv/static/adminfe/chunk-15fa.86ad6a40.css
rename to priv/static/adminfe/chunk-15fa.dc3643e6.css
diff --git a/priv/static/adminfe/chunk-17a5.edcdbe30.css b/priv/static/adminfe/chunk-17a5.edcdbe30.css
new file mode 100644
index 000000000..0b2a3f669
Binary files /dev/null and b/priv/static/adminfe/chunk-17a5.edcdbe30.css differ
diff --git a/priv/static/adminfe/chunk-20e0.ee636d82.css b/priv/static/adminfe/chunk-20e0.ee636d82.css
deleted file mode 100644
index 567079fed..000000000
Binary files a/priv/static/adminfe/chunk-20e0.ee636d82.css and /dev/null differ
diff --git a/priv/static/adminfe/chunk-293a.a8b5ee5b.css b/priv/static/adminfe/chunk-293a.a8b5ee5b.css
new file mode 100644
index 000000000..924633a80
Binary files /dev/null and b/priv/static/adminfe/chunk-293a.a8b5ee5b.css differ
diff --git a/priv/static/adminfe/chunk-3c9a.cf7aabee.css b/priv/static/adminfe/chunk-2b8b.0f1ee211.css
similarity index 100%
rename from priv/static/adminfe/chunk-3c9a.cf7aabee.css
rename to priv/static/adminfe/chunk-2b8b.0f1ee211.css
diff --git a/priv/static/adminfe/chunk-453a.bbab87da.css b/priv/static/adminfe/chunk-453a.bbab87da.css
new file mode 100644
index 000000000..d6cc7d182
Binary files /dev/null and b/priv/static/adminfe/chunk-453a.bbab87da.css differ
diff --git a/priv/static/adminfe/chunk-46cf.6dd5bbb7.css b/priv/static/adminfe/chunk-46cf.6dd5bbb7.css
new file mode 100644
index 000000000..aa7160528
Binary files /dev/null and b/priv/static/adminfe/chunk-46cf.6dd5bbb7.css differ
diff --git a/priv/static/adminfe/chunk-48a4.1bb1db91.css b/priv/static/adminfe/chunk-48a4.1bb1db91.css
deleted file mode 100644
index 48784b9d2..000000000
Binary files a/priv/static/adminfe/chunk-48a4.1bb1db91.css and /dev/null differ
diff --git a/priv/static/adminfe/chunk-51b0.55057987.css b/priv/static/adminfe/chunk-4e46.ad5e9ff3.css
similarity index 100%
rename from priv/static/adminfe/chunk-51b0.55057987.css
rename to priv/static/adminfe/chunk-4e46.ad5e9ff3.css
diff --git a/priv/static/adminfe/chunk-560d.802cfba1.css b/priv/static/adminfe/chunk-560d.802cfba1.css
new file mode 100644
index 000000000..a74b42d14
Binary files /dev/null and b/priv/static/adminfe/chunk-560d.802cfba1.css differ
diff --git a/priv/static/adminfe/chunk-6aa3.fb02ac69.css b/priv/static/adminfe/chunk-6dd6.85f319f7.css
similarity index 100%
rename from priv/static/adminfe/chunk-6aa3.fb02ac69.css
rename to priv/static/adminfe/chunk-6dd6.85f319f7.css
diff --git a/priv/static/adminfe/chunk-7f8e.f03bd164.css b/priv/static/adminfe/chunk-7f8e.f03bd164.css
deleted file mode 100644
index 6cd674a28..000000000
Binary files a/priv/static/adminfe/chunk-7f8e.f03bd164.css and /dev/null differ
diff --git a/priv/static/adminfe/chunk-b4ba.e55f897a.css b/priv/static/adminfe/chunk-b4ba.e55f897a.css
deleted file mode 100644
index dadc5cbda..000000000
Binary files a/priv/static/adminfe/chunk-b4ba.e55f897a.css and /dev/null differ
diff --git a/priv/static/adminfe/chunk-cf58.6bdb954d.css b/priv/static/adminfe/chunk-cf58.80435fa1.css
similarity index 55%
rename from priv/static/adminfe/chunk-cf58.6bdb954d.css
rename to priv/static/adminfe/chunk-cf58.80435fa1.css
index 69fc0072a..8b0f21153 100644
Binary files a/priv/static/adminfe/chunk-cf58.6bdb954d.css and b/priv/static/adminfe/chunk-cf58.80435fa1.css differ
diff --git a/priv/static/adminfe/index.html b/priv/static/adminfe/index.html
index 0a63dab0f..b0bdb162d 100644
--- a/priv/static/adminfe/index.html
+++ b/priv/static/adminfe/index.html
@@ -1 +1 @@
-
Admin FE
\ No newline at end of file
+Admin FE
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/app.30262183.js b/priv/static/adminfe/static/js/app.30262183.js
new file mode 100644
index 000000000..c872d448f
Binary files /dev/null and b/priv/static/adminfe/static/js/app.30262183.js differ
diff --git a/priv/static/adminfe/static/js/app.30262183.js.map b/priv/static/adminfe/static/js/app.30262183.js.map
new file mode 100644
index 000000000..3711b8a98
Binary files /dev/null and b/priv/static/adminfe/static/js/app.30262183.js.map differ
diff --git a/priv/static/adminfe/static/js/app.9898fa4b.js b/priv/static/adminfe/static/js/app.9898fa4b.js
deleted file mode 100644
index a8c320dc9..000000000
Binary files a/priv/static/adminfe/static/js/app.9898fa4b.js and /dev/null differ
diff --git a/priv/static/adminfe/static/js/app.9898fa4b.js.map b/priv/static/adminfe/static/js/app.9898fa4b.js.map
deleted file mode 100644
index 09522dd0c..000000000
Binary files a/priv/static/adminfe/static/js/app.9898fa4b.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-03b0.7a203856.js b/priv/static/adminfe/static/js/chunk-03b0.7a203856.js
new file mode 100644
index 000000000..43ca0e4e6
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-03b0.7a203856.js differ
diff --git a/priv/static/adminfe/static/js/chunk-03b0.7a203856.js.map b/priv/static/adminfe/static/js/chunk-03b0.7a203856.js.map
new file mode 100644
index 000000000..697a106ac
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-03b0.7a203856.js.map differ
diff --git a/priv/static/adminfe/static/js/chunk-03b0.99b22464.js b/priv/static/adminfe/static/js/chunk-03b0.99b22464.js
deleted file mode 100644
index 104d3568d..000000000
Binary files a/priv/static/adminfe/static/js/chunk-03b0.99b22464.js and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-03b0.99b22464.js.map b/priv/static/adminfe/static/js/chunk-03b0.99b22464.js.map
deleted file mode 100644
index 9f28a108c..000000000
Binary files a/priv/static/adminfe/static/js/chunk-03b0.99b22464.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-06de.ff4586ab.js b/priv/static/adminfe/static/js/chunk-06de.ff4586ab.js
deleted file mode 100644
index c989bed18..000000000
Binary files a/priv/static/adminfe/static/js/chunk-06de.ff4586ab.js and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-06de.ff4586ab.js.map b/priv/static/adminfe/static/js/chunk-06de.ff4586ab.js.map
deleted file mode 100644
index 5652f3192..000000000
Binary files a/priv/static/adminfe/static/js/chunk-06de.ff4586ab.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-15fa.99004e49.js b/priv/static/adminfe/static/js/chunk-15fa.15303f3a.js
similarity index 99%
rename from priv/static/adminfe/static/js/chunk-15fa.99004e49.js
rename to priv/static/adminfe/static/js/chunk-15fa.15303f3a.js
index 5ab46f8b9..7d3e0c56e 100644
Binary files a/priv/static/adminfe/static/js/chunk-15fa.99004e49.js and b/priv/static/adminfe/static/js/chunk-15fa.15303f3a.js differ
diff --git a/priv/static/adminfe/static/js/chunk-15fa.99004e49.js.map b/priv/static/adminfe/static/js/chunk-15fa.15303f3a.js.map
similarity index 99%
rename from priv/static/adminfe/static/js/chunk-15fa.99004e49.js.map
rename to priv/static/adminfe/static/js/chunk-15fa.15303f3a.js.map
index f4b92260a..f08d1dbf9 100644
Binary files a/priv/static/adminfe/static/js/chunk-15fa.99004e49.js.map and b/priv/static/adminfe/static/js/chunk-15fa.15303f3a.js.map differ
diff --git a/priv/static/adminfe/static/js/chunk-17a5.13b13757.js b/priv/static/adminfe/static/js/chunk-17a5.13b13757.js
new file mode 100644
index 000000000..80e7a8ac7
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-17a5.13b13757.js differ
diff --git a/priv/static/adminfe/static/js/chunk-17a5.13b13757.js.map b/priv/static/adminfe/static/js/chunk-17a5.13b13757.js.map
new file mode 100644
index 000000000..7da1a0077
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-17a5.13b13757.js.map differ
diff --git a/priv/static/adminfe/static/js/chunk-20e0.dc3e8a45.js b/priv/static/adminfe/static/js/chunk-20e0.dc3e8a45.js
deleted file mode 100644
index 5fa5107f4..000000000
Binary files a/priv/static/adminfe/static/js/chunk-20e0.dc3e8a45.js and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-20e0.dc3e8a45.js.map b/priv/static/adminfe/static/js/chunk-20e0.dc3e8a45.js.map
deleted file mode 100644
index 2186ce225..000000000
Binary files a/priv/static/adminfe/static/js/chunk-20e0.dc3e8a45.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-293a.a728de01.js b/priv/static/adminfe/static/js/chunk-293a.a728de01.js
new file mode 100644
index 000000000..c856e21eb
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-293a.a728de01.js differ
diff --git a/priv/static/adminfe/static/js/chunk-293a.a728de01.js.map b/priv/static/adminfe/static/js/chunk-293a.a728de01.js.map
new file mode 100644
index 000000000..03f61abcb
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-293a.a728de01.js.map differ
diff --git a/priv/static/adminfe/static/js/chunk-2b8b.e3daf966.js b/priv/static/adminfe/static/js/chunk-2b8b.e3daf966.js
new file mode 100644
index 000000000..4b100db60
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-2b8b.e3daf966.js differ
diff --git a/priv/static/adminfe/static/js/chunk-2b8b.e3daf966.js.map b/priv/static/adminfe/static/js/chunk-2b8b.e3daf966.js.map
new file mode 100644
index 000000000..a7282eaf4
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-2b8b.e3daf966.js.map differ
diff --git a/priv/static/adminfe/static/js/chunk-3c9a.87da94e3.js b/priv/static/adminfe/static/js/chunk-3c9a.87da94e3.js
deleted file mode 100644
index c151fbbe6..000000000
Binary files a/priv/static/adminfe/static/js/chunk-3c9a.87da94e3.js and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-3c9a.87da94e3.js.map b/priv/static/adminfe/static/js/chunk-3c9a.87da94e3.js.map
deleted file mode 100644
index f8fb49a72..000000000
Binary files a/priv/static/adminfe/static/js/chunk-3c9a.87da94e3.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-48a4.e3d2c4b6.js b/priv/static/adminfe/static/js/chunk-453a.2fcd7192.js
similarity index 89%
rename from priv/static/adminfe/static/js/chunk-48a4.e3d2c4b6.js
rename to priv/static/adminfe/static/js/chunk-453a.2fcd7192.js
index 596384cab..b0ee1b6b0 100644
Binary files a/priv/static/adminfe/static/js/chunk-48a4.e3d2c4b6.js and b/priv/static/adminfe/static/js/chunk-453a.2fcd7192.js differ
diff --git a/priv/static/adminfe/static/js/chunk-453a.2fcd7192.js.map b/priv/static/adminfe/static/js/chunk-453a.2fcd7192.js.map
new file mode 100644
index 000000000..b43d2f571
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-453a.2fcd7192.js.map differ
diff --git a/priv/static/adminfe/static/js/chunk-46cf.104380a9.js b/priv/static/adminfe/static/js/chunk-46cf.104380a9.js
new file mode 100644
index 000000000..9e1e1520b
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-46cf.104380a9.js differ
diff --git a/priv/static/adminfe/static/js/chunk-46cf.104380a9.js.map b/priv/static/adminfe/static/js/chunk-46cf.104380a9.js.map
new file mode 100644
index 000000000..b9357ca8f
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-46cf.104380a9.js.map differ
diff --git a/priv/static/adminfe/static/js/chunk-48a4.e3d2c4b6.js.map b/priv/static/adminfe/static/js/chunk-48a4.e3d2c4b6.js.map
deleted file mode 100644
index f3d7fd870..000000000
Binary files a/priv/static/adminfe/static/js/chunk-48a4.e3d2c4b6.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-51b0.7d1554b1.js b/priv/static/adminfe/static/js/chunk-4e46.d257e435.js
similarity index 85%
rename from priv/static/adminfe/static/js/chunk-51b0.7d1554b1.js
rename to priv/static/adminfe/static/js/chunk-4e46.d257e435.js
index a770215ae..39c5dcc4e 100644
Binary files a/priv/static/adminfe/static/js/chunk-51b0.7d1554b1.js and b/priv/static/adminfe/static/js/chunk-4e46.d257e435.js differ
diff --git a/priv/static/adminfe/static/js/chunk-51b0.7d1554b1.js.map b/priv/static/adminfe/static/js/chunk-4e46.d257e435.js.map
similarity index 98%
rename from priv/static/adminfe/static/js/chunk-51b0.7d1554b1.js.map
rename to priv/static/adminfe/static/js/chunk-4e46.d257e435.js.map
index 9b8014486..75d3554ac 100644
Binary files a/priv/static/adminfe/static/js/chunk-51b0.7d1554b1.js.map and b/priv/static/adminfe/static/js/chunk-4e46.d257e435.js.map differ
diff --git a/priv/static/adminfe/static/js/chunk-560d.a8bb8682.js b/priv/static/adminfe/static/js/chunk-560d.a8bb8682.js
new file mode 100644
index 000000000..0b03305e9
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-560d.a8bb8682.js differ
diff --git a/priv/static/adminfe/static/js/chunk-560d.a8bb8682.js.map b/priv/static/adminfe/static/js/chunk-560d.a8bb8682.js.map
new file mode 100644
index 000000000..bfab1ade9
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-560d.a8bb8682.js.map differ
diff --git a/priv/static/adminfe/static/js/chunk-6aa3.95b2c0b4.js b/priv/static/adminfe/static/js/chunk-6dd6.6c139a9c.js
similarity index 97%
rename from priv/static/adminfe/static/js/chunk-6aa3.95b2c0b4.js
rename to priv/static/adminfe/static/js/chunk-6dd6.6c139a9c.js
index 1d44bee16..670016168 100644
Binary files a/priv/static/adminfe/static/js/chunk-6aa3.95b2c0b4.js and b/priv/static/adminfe/static/js/chunk-6dd6.6c139a9c.js differ
diff --git a/priv/static/adminfe/static/js/chunk-6aa3.95b2c0b4.js.map b/priv/static/adminfe/static/js/chunk-6dd6.6c139a9c.js.map
similarity index 99%
rename from priv/static/adminfe/static/js/chunk-6aa3.95b2c0b4.js.map
rename to priv/static/adminfe/static/js/chunk-6dd6.6c139a9c.js.map
index aa3fa8ee1..b1438722c 100644
Binary files a/priv/static/adminfe/static/js/chunk-6aa3.95b2c0b4.js.map and b/priv/static/adminfe/static/js/chunk-6dd6.6c139a9c.js.map differ
diff --git a/priv/static/adminfe/static/js/chunk-7f8e.a4876ede.js b/priv/static/adminfe/static/js/chunk-7f8e.a4876ede.js
deleted file mode 100644
index e3025b00f..000000000
Binary files a/priv/static/adminfe/static/js/chunk-7f8e.a4876ede.js and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-7f8e.a4876ede.js.map b/priv/static/adminfe/static/js/chunk-7f8e.a4876ede.js.map
deleted file mode 100644
index c34b1dc46..000000000
Binary files a/priv/static/adminfe/static/js/chunk-7f8e.a4876ede.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-b4ba.f717f3b2.js b/priv/static/adminfe/static/js/chunk-b4ba.f717f3b2.js
deleted file mode 100644
index b748c0739..000000000
Binary files a/priv/static/adminfe/static/js/chunk-b4ba.f717f3b2.js and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-b4ba.f717f3b2.js.map b/priv/static/adminfe/static/js/chunk-b4ba.f717f3b2.js.map
deleted file mode 100644
index 2871c747d..000000000
Binary files a/priv/static/adminfe/static/js/chunk-b4ba.f717f3b2.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-cf58.438233c4.js.map b/priv/static/adminfe/static/js/chunk-cf58.438233c4.js.map
deleted file mode 100644
index dd70f756c..000000000
Binary files a/priv/static/adminfe/static/js/chunk-cf58.438233c4.js.map and /dev/null differ
diff --git a/priv/static/adminfe/static/js/chunk-cf58.438233c4.js b/priv/static/adminfe/static/js/chunk-cf58.e52693b3.js
similarity index 99%
rename from priv/static/adminfe/static/js/chunk-cf58.438233c4.js
rename to priv/static/adminfe/static/js/chunk-cf58.e52693b3.js
index 5c22b4ba4..b74c20373 100644
Binary files a/priv/static/adminfe/static/js/chunk-cf58.438233c4.js and b/priv/static/adminfe/static/js/chunk-cf58.e52693b3.js differ
diff --git a/priv/static/adminfe/static/js/chunk-cf58.e52693b3.js.map b/priv/static/adminfe/static/js/chunk-cf58.e52693b3.js.map
new file mode 100644
index 000000000..0f3f15299
Binary files /dev/null and b/priv/static/adminfe/static/js/chunk-cf58.e52693b3.js.map differ
diff --git a/priv/static/adminfe/static/js/runtime.929009b0.js b/priv/static/adminfe/static/js/runtime.ae93ea9f.js
similarity index 54%
rename from priv/static/adminfe/static/js/runtime.929009b0.js
rename to priv/static/adminfe/static/js/runtime.ae93ea9f.js
index 69f4b46ed..ebda2acde 100644
Binary files a/priv/static/adminfe/static/js/runtime.929009b0.js and b/priv/static/adminfe/static/js/runtime.ae93ea9f.js differ
diff --git a/priv/static/adminfe/static/js/runtime.929009b0.js.map b/priv/static/adminfe/static/js/runtime.ae93ea9f.js.map
similarity index 90%
rename from priv/static/adminfe/static/js/runtime.929009b0.js.map
rename to priv/static/adminfe/static/js/runtime.ae93ea9f.js.map
index 3e546dd9f..6392c981a 100644
Binary files a/priv/static/adminfe/static/js/runtime.929009b0.js.map and b/priv/static/adminfe/static/js/runtime.ae93ea9f.js.map differ
diff --git a/test/web/admin_api/admin_api_controller_test.exs b/test/web/admin_api/admin_api_controller_test.exs
index 0b79e4c5c..777e85938 100644
--- a/test/web/admin_api/admin_api_controller_test.exs
+++ b/test/web/admin_api/admin_api_controller_test.exs
@@ -3065,6 +3065,52 @@ test "pleroma restarts", %{conn: conn} do
end
end
+ describe "GET /api/pleroma/admin/statuses" do
+ test "returns all public, unlisted, and direct statuses", %{conn: conn, admin: admin} do
+ blocked = insert(:user)
+ user = insert(:user)
+ User.block(admin, blocked)
+
+ {:ok, _} =
+ CommonAPI.post(user, %{"status" => "@#{admin.nickname}", "visibility" => "direct"})
+
+ {:ok, _} = CommonAPI.post(user, %{"status" => ".", "visibility" => "unlisted"})
+ {:ok, _} = CommonAPI.post(user, %{"status" => ".", "visibility" => "private"})
+ {:ok, _} = CommonAPI.post(user, %{"status" => ".", "visibility" => "public"})
+ {:ok, _} = CommonAPI.post(blocked, %{"status" => ".", "visibility" => "public"})
+
+ response =
+ conn
+ |> get("/api/pleroma/admin/statuses")
+ |> json_response(200)
+
+ refute "private" in Enum.map(response, & &1["visibility"])
+ assert length(response) == 4
+ end
+
+ test "returns only local statuses with local_only on", %{conn: conn} do
+ user = insert(:user)
+ remote_user = insert(:user, local: false, nickname: "archaeme@archae.me")
+ insert(:note_activity, user: user, local: true)
+ insert(:note_activity, user: remote_user, local: false)
+
+ response =
+ conn
+ |> get("/api/pleroma/admin/statuses?local_only=true")
+ |> json_response(200)
+
+ assert length(response) == 1
+ end
+
+ test "returns private statuses with godmode on", %{conn: conn} do
+ user = insert(:user)
+ {:ok, _} = CommonAPI.post(user, %{"status" => ".", "visibility" => "private"})
+ {:ok, _} = CommonAPI.post(user, %{"status" => ".", "visibility" => "public"})
+ conn = get(conn, "/api/pleroma/admin/statuses?godmode=true")
+ assert json_response(conn, 200) |> length() == 2
+ end
+ end
+
describe "GET /api/pleroma/admin/users/:nickname/statuses" do
setup do
user = insert(:user)
@@ -3115,6 +3161,20 @@ test "returns private statuses with godmode on", %{conn: conn, user: user} do
assert json_response(conn, 200) |> length() == 5
end
+
+ test "excludes reblogs by default", %{conn: conn, user: user} do
+ other_user = insert(:user)
+ {:ok, activity} = CommonAPI.post(user, %{"status" => "."})
+ {:ok, %Activity{}, _} = CommonAPI.repeat(activity.id, other_user)
+
+ conn_res = get(conn, "/api/pleroma/admin/users/#{other_user.nickname}/statuses")
+ assert json_response(conn_res, 200) |> length() == 0
+
+ conn_res =
+ get(conn, "/api/pleroma/admin/users/#{other_user.nickname}/statuses?with_reblogs=true")
+
+ assert json_response(conn_res, 200) |> length() == 1
+ end
end
describe "GET /api/pleroma/admin/moderation_log" do
@@ -3397,7 +3457,7 @@ test "GET /instances/:instance/statuses", %{conn: conn} do
user = insert(:user, local: false, nickname: "archaeme@archae.me")
user2 = insert(:user, local: false, nickname: "test@test.com")
insert_pair(:note_activity, user: user)
- insert(:note_activity, user: user2)
+ activity = insert(:note_activity, user: user2)
ret_conn = get(conn, "/api/pleroma/admin/instances/archae.me/statuses")
@@ -3416,6 +3476,16 @@ test "GET /instances/:instance/statuses", %{conn: conn} do
response = json_response(ret_conn, 200)
assert Enum.empty?(response)
+
+ CommonAPI.repeat(activity.id, user)
+
+ ret_conn = get(conn, "/api/pleroma/admin/instances/archae.me/statuses")
+ response = json_response(ret_conn, 200)
+ assert length(response) == 2
+
+ ret_conn = get(conn, "/api/pleroma/admin/instances/archae.me/statuses?with_reblogs=true")
+ response = json_response(ret_conn, 200)
+ assert length(response) == 3
end
end