Add basic config endpoint.
authorRoger Braun <roger@rogerbraun.net>
Wed, 12 Apr 2017 15:47:05 +0000 (17:47 +0200)
committerRoger Braun <roger@rogerbraun.net>
Wed, 12 Apr 2017 15:47:05 +0000 (17:47 +0200)
lib/pleroma/web/router.ex
lib/pleroma/web/twitter_api/twitter_api_controller.ex

index 52030d684ac16d093977094286974f7bcd94dde8..17eab293ad1cf796ea7021c757c5ac14331be5b9 100644 (file)
@@ -25,6 +25,7 @@ defmodule Pleroma.Web.Router do
     get "/statuses/public_and_external_timeline", TwitterAPI.Controller, :public_timeline
     get "/statuses/show/:id", TwitterAPI.Controller, :fetch_status
     get "/statusnet/conversation/:id", TwitterAPI.Controller, :fetch_conversation
+    get "/statusnet/config", TwitterAPI.Controller, :config
   end
 
   scope "/api", Pleroma.Web do
index c3a58b63a8dee40ea04e76ebb1bf329e9118f25a..3f299a941690e2a93d0e5013ecec9c53e9f90e8f 100644 (file)
@@ -83,6 +83,20 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
     |> send_resp(200, response)
   end
 
+  def config(conn, _params) do
+    response = %{
+      site: %{
+        name: Pleroma.Web.base_url,
+        server: Pleroma.Web.base_url,
+        textlimit: -1
+      }
+    }
+    |> Poison.encode!
+
+    conn
+    |> json_reply(200, response)
+  end
+
   defp json_reply(conn, status, json) do
     conn
     |> put_resp_content_type("application/json")