- @instance Application.get_env(:pleroma, :instance)
- @allowed_post_formats Keyword.get(@instance, :allowed_post_formats)
-
- defp get_content_type(content_type) when content_type in @allowed_post_formats, do: content_type
- defp get_content_type(_), do: "text/plain"
+ defp get_content_type(content_type) do
+ if Enum.member?(Pleroma.Config.get([:instance, :allowed_post_formats]), content_type) do
+ content_type
+ else
+ "text/plain"
+ end
+ end