X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fconfig%2Fconfig_db.ex;h=2b43d4c365f91586b5e0a9b569958fce83048a74;hb=767ce8b8030562935ccd9f7c3d9ed83af0735db0;hp=91a1aa0cc2cf3781bf0b759ed2382418bea8a492;hpb=2cfe1b93854c117fda19e54ea17c99f72413a569;p=akkoma
diff --git a/lib/pleroma/config/config_db.ex b/lib/pleroma/config/config_db.ex
index 91a1aa0cc..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
@@ -236,15 +236,7 @@ defmodule Pleroma.ConfigDB do
end
@spec from_string(String.t()) :: atom() | no_return()
- def from_string(":" <> entity), do: String.to_existing_atom(entity)
-
- def from_string(entity) when is_binary(entity) do
- if is_module_name?(entity) do
- String.to_existing_atom("Elixir.#{entity}")
- else
- entity
- end
- end
+ def from_string(string), do: do_transform_string(string)
@spec convert(any()) :: any()
def convert(entity), do: do_convert(entity)
@@ -416,7 +408,7 @@ defmodule Pleroma.ConfigDB do
@spec is_module_name?(String.t()) :: boolean()
def is_module_name?(string) do
- Regex.match?(~r/^(Pleroma|Phoenix|Tesla|Quack|Ueberauth)\./, string) or
+ Regex.match?(~r/^(Pleroma|Phoenix|Tesla|Quack|Ueberauth|Swoosh)\./, string) or
string in ["Oban", "Ueberauth", "ExSyslogger"]
end
end