Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
760B

  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.TwitterAPI.UtilView do
  5. use Pleroma.Web, :view
  6. import Phoenix.HTML.Form
  7. alias Pleroma.Config
  8. alias Pleroma.Web.Endpoint
  9. def status_net_config(instance) do
  10. """
  11. <config>
  12. <site>
  13. <name>#{Keyword.get(instance, :name)}</name>
  14. <site>#{Endpoint.url()}</site>
  15. <textlimit>#{Keyword.get(instance, :limit)}</textlimit>
  16. <closed>#{!Keyword.get(instance, :registrations_open)}</closed>
  17. </site>
  18. </config>
  19. """
  20. end
  21. def render("frontend_configurations.json", _) do
  22. Config.get(:frontend_configurations, %{})
  23. |> Enum.into(%{})
  24. end
  25. end