mastodon api: report version as the Mastodon API version supported with the real version in parenthesis

This commit is contained in:
William Pitcock 2018-04-07 22:27:16 +00:00
parent 52a1a40d7d
commit 1857f403be

View file

@ -102,13 +102,14 @@ def user(conn, %{"id" => id}) do
end end
@instance Application.get_env(:pleroma, :instance) @instance Application.get_env(:pleroma, :instance)
@mastodon_api_level "2.3.3"
def masto_instance(conn, _params) do def masto_instance(conn, _params) do
response = %{ response = %{
uri: Web.base_url(), uri: Web.base_url(),
title: Keyword.get(@instance, :name), title: Keyword.get(@instance, :name),
description: "A Pleroma instance, an alternative fediverse server", description: "A Pleroma instance, an alternative fediverse server",
version: Keyword.get(@instance, :version), version: "#{@mastodon_api_level} (compatible; #{Keyword.get(@instance, :version)})",
email: Keyword.get(@instance, :email), email: Keyword.get(@instance, :email),
urls: %{ urls: %{
streaming_api: String.replace(Web.base_url(), ["http", "https"], "wss") streaming_api: String.replace(Web.base_url(), ["http", "https"], "wss")