summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2023-12-23 15:51:20 +0100
committermarcin mikołajczak <git@mkljczk.pl>2023-12-27 21:24:20 +0100
commitf6fee39e42e633ff4298291dca0db656c92dad81 (patch)
tree6d638dee23629f12b0539465dd19a733b2b6146f
parent6051715a990b7eb4379daec46d5ea0d63dce2c09 (diff)
downloadpleroma-f6fee39e42e633ff4298291dca0db656c92dad81.tar.gz
pleroma-f6fee39e42e633ff4298291dca0db656c92dad81.zip
Add changelog
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
-rw-r--r--changelog.d/instance-rules.add1
-rw-r--r--lib/pleroma/web/api_spec.ex1
-rw-r--r--lib/pleroma/web/api_spec/operations/instance_operation.ex2
-rw-r--r--lib/pleroma/web/mastodon_api/views/instance_view.ex18
4 files changed, 12 insertions, 10 deletions
diff --git a/changelog.d/instance-rules.add b/changelog.d/instance-rules.add
new file mode 100644
index 000000000..42f3cbfa1
--- /dev/null
+++ b/changelog.d/instance-rules.add
@@ -0,0 +1 @@
+Add instance rules \ No newline at end of file
diff --git a/lib/pleroma/web/api_spec.ex b/lib/pleroma/web/api_spec.ex
index 163226ce5..0eedf4aea 100644
--- a/lib/pleroma/web/api_spec.ex
+++ b/lib/pleroma/web/api_spec.ex
@@ -97,6 +97,7 @@ defmodule Pleroma.Web.ApiSpec do
"Frontend managment",
"Instance configuration",
"Instance documents",
+ "Instance rule managment",
"Invites",
"MediaProxy cache",
"OAuth application managment",
diff --git a/lib/pleroma/web/api_spec/operations/instance_operation.ex b/lib/pleroma/web/api_spec/operations/instance_operation.ex
index a22eb5bc9..452e56e45 100644
--- a/lib/pleroma/web/api_spec/operations/instance_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/instance_operation.ex
@@ -48,7 +48,7 @@ defmodule Pleroma.Web.ApiSpec.InstanceOperation do
def rules_operation do
%Operation{
- tags: ["Instance"],
+ tags: ["Instance misc"],
summary: "Retrieve list of instance rules",
operationId: "InstanceController.rules",
responses: %{
diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex
index fa3726d4a..62c6b9e2e 100644
--- a/lib/pleroma/web/mastodon_api/views/instance_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/instance_view.ex
@@ -73,15 +73,6 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
})
end
- defp common_information(instance) do
- %{
- languages: Keyword.get(instance, :languages, ["en"]),
- rules: render(__MODULE__, "rules.json"),
- title: Keyword.get(instance, :name),
- version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})"
- }
- end
-
def render("rules.json", _) do
Pleroma.Rule.query()
|> Pleroma.Repo.all()
@@ -95,6 +86,15 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
}
end
+ defp common_information(instance) do
+ %{
+ languages: Keyword.get(instance, :languages, ["en"]),
+ rules: render(__MODULE__, "rules.json"),
+ title: Keyword.get(instance, :name),
+ version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})"
+ }
+ end
+
def features do
[
"pleroma_api",