X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fconfig%2Fconfig_db.ex;h=2b43d4c365f91586b5e0a9b569958fce83048a74;hb=954acdda2072cac343409b3d17d831b86ac6a18c;hp=bdacefa979d94365b79ebb3cae10f1dd515c2b62;hpb=d9e4b77f8be8249b428a7ef1448c9a2161dee88a;p=akkoma
diff --git a/lib/pleroma/config/config_db.ex b/lib/pleroma/config/config_db.ex
index bdacefa97..2b43d4c36 100644
--- a/lib/pleroma/config/config_db.ex
+++ b/lib/pleroma/config/config_db.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ConfigDB do
@@ -278,6 +278,8 @@ defmodule Pleroma.ConfigDB do
}
end
+ defp do_convert({:partial_chain, entity}), do: %{"tuple" => [":partial_chain", inspect(entity)]}
+
defp do_convert(entity) when is_tuple(entity) do
value =
entity
@@ -321,6 +323,15 @@ defmodule Pleroma.ConfigDB do
{:proxy_url, {do_transform_string(type), parse_host(host), port}}
end
+ defp do_transform(%{"tuple" => [":partial_chain", entity]}) do
+ {partial_chain, []} =
+ entity
+ |> String.replace(~r/[^\w|^{:,[|^,|^[|^\]^}|^\/|^\.|^"]^\s/, "")
+ |> Code.eval_string()
+
+ {:partial_chain, partial_chain}
+ end
+
defp do_transform(%{"tuple" => entity}) do
Enum.reduce(entity, {}, fn val, acc -> Tuple.append(acc, do_transform(val)) end)
end