Merge branch 'develop' into activation-meta
[akkoma] / lib / pleroma / web / twitter_api / controllers / util_controller.ex
index d5d5ce08f817938c9508e05af72b7e463a499178..aaca182ecc1ac5c194abfdb4e86a501585cddc5a 100644 (file)
@@ -15,6 +15,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
   alias Pleroma.User
   alias Pleroma.Web
   alias Pleroma.Web.CommonAPI
+  alias Pleroma.Web.TwitterAPI.UtilView
   alias Pleroma.Web.WebFinger
 
   plug(Pleroma.Web.FederatingPlug when action == :remote_subscribe)
@@ -25,13 +26,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
     when action == :follow_import
   )
 
-  # Note: follower can submit the form (with password auth) not being signed in (having no token)
-  plug(
-    OAuthScopesPlug,
-    %{fallback: :proceed_unauthenticated, scopes: ["follow", "write:follows"]}
-    when action == :do_remote_follow
-  )
-
   plug(OAuthScopesPlug, %{scopes: ["follow", "write:blocks"]} when action == :blocks_import)
 
   plug(
@@ -97,17 +91,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
 
   def config(%{assigns: %{format: "xml"}} = conn, _params) do
     instance = Pleroma.Config.get(:instance)
-
-    response = """
-    <config>
-    <site>
-    <name>#{Keyword.get(instance, :name)}</name>
-    <site>#{Web.base_url()}</site>
-    <textlimit>#{Keyword.get(instance, :limit)}</textlimit>
-    <closed>#{!Keyword.get(instance, :registrations_open)}</closed>
-    </site>
-    </config>
-    """
+    response = UtilView.status_net_config(instance)
 
     conn
     |> put_resp_content_type("application/xml")