From: Roger Braun Date: Wed, 12 Apr 2017 15:47:05 +0000 (+0200) Subject: Add basic config endpoint. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=129e30f4658312e8bb1737fd5577497107fbdeb1;p=akkoma Add basic config endpoint. --- diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index 52030d684..17eab293a 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -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 diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index c3a58b63a..3f299a941 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -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")