forked from AkkomaGang/akkoma
Add key- and valuePlaceholders for quarantined_instances and mrf_simple
* I also added for keywordpolicy as well now. It was done in the admin-fe, but is better to be done here * I also added comments to explain why we did the _info keys (backwards compatibility)
This commit is contained in:
parent
9418424048
commit
f4028c908c
4 changed files with 12 additions and 0 deletions
|
@ -688,6 +688,8 @@
|
||||||
%{
|
%{
|
||||||
key: :quarantined_instances,
|
key: :quarantined_instances,
|
||||||
type: {:list, :tuple},
|
type: {:list, :tuple},
|
||||||
|
keyPlaceholder: "instance",
|
||||||
|
valuePlaceholder: "reason",
|
||||||
description:
|
description:
|
||||||
"List of ActivityPub instances where private (DMs, followers-only) activities will not be sent and the reason for doing so",
|
"List of ActivityPub instances where private (DMs, followers-only) activities will not be sent and the reason for doing so",
|
||||||
suggestions: [
|
suggestions: [
|
||||||
|
|
|
@ -159,6 +159,8 @@ def config_description do
|
||||||
%{
|
%{
|
||||||
key: :replace,
|
key: :replace,
|
||||||
type: {:list, :tuple},
|
type: {:list, :tuple},
|
||||||
|
keyPlaceholder: "pattern",
|
||||||
|
valuePlaceholder: "replacement",
|
||||||
description: """
|
description: """
|
||||||
**Pattern**: a string or [Regex](https://hexdocs.pm/elixir/Regex.html) in the format of `~r/PATTERN/`.
|
**Pattern**: a string or [Regex](https://hexdocs.pm/elixir/Regex.html) in the format of `~r/PATTERN/`.
|
||||||
|
|
||||||
|
|
|
@ -271,6 +271,10 @@ def describe do
|
||||||
end)
|
end)
|
||||||
|> Enum.into(%{})
|
|> Enum.into(%{})
|
||||||
|
|
||||||
|
# This is for backwards compatibility. We originally didn't sent
|
||||||
|
# extra info like a reason why an instance was rejected/quarantined/etc.
|
||||||
|
# Because we didn't want to break backwards compatibility it was decided
|
||||||
|
# to add an extra "info" key.
|
||||||
mrf_simple_info =
|
mrf_simple_info =
|
||||||
mrf_simple_excluded
|
mrf_simple_excluded
|
||||||
|> Enum.map(fn {k, v} -> {k, Enum.reject(v, fn {_, reason} -> reason == "" end)} end)
|
|> Enum.map(fn {k, v} -> {k, Enum.reject(v, fn {_, reason} -> reason == "" end)} end)
|
||||||
|
|
|
@ -100,6 +100,10 @@ def federation do
|
||||||
quarantined
|
quarantined
|
||||||
|> Enum.map(fn {instance, _reason} -> instance end)
|
|> Enum.map(fn {instance, _reason} -> instance end)
|
||||||
})
|
})
|
||||||
|
# This is for backwards compatibility. We originally didn't sent
|
||||||
|
# extra info like a reason why an instance was rejected/quarantined/etc.
|
||||||
|
# Because we didn't want to break backwards compatibility it was decided
|
||||||
|
# to add an extra "info" key.
|
||||||
|> Map.merge(%{
|
|> Map.merge(%{
|
||||||
quarantined_instances_info: %{
|
quarantined_instances_info: %{
|
||||||
"quarantined_instances" =>
|
"quarantined_instances" =>
|
||||||
|
|
Loading…
Reference in a new issue