Commit 024c11c1 authored by lain's avatar lain
Browse files

StatusController: Deactivate application support for now.

Some more things to discuss about, so we'll remove it from 2.3.0
parent cd6aa9bc
Pipeline #35303 failed with stages
in 6 minutes and 46 seconds
......@@ -21,7 +21,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.MastodonAPI.AccountView
alias Pleroma.Web.MastodonAPI.ScheduledActivityView
alias Pleroma.Web.OAuth.Token
# alias Pleroma.Web.OAuth.Token
alias Pleroma.Web.Plugs.OAuthScopesPlug
alias Pleroma.Web.Plugs.RateLimiter
......@@ -420,14 +420,15 @@ def bookmarks(%{assigns: %{user: user}} = conn, params) do
)
end
defp put_application(params, %{assigns: %{token: %Token{user: %User{} = user} = token}} = _conn) do
if user.disclose_client do
%{client_name: client_name, website: website} = Repo.preload(token, :app).app
Map.put(params, :generator, %{type: "Application", name: client_name, url: website})
else
Map.put(params, :generator, nil)
end
end
# Deactivated for 2.3.0
# defp put_application(params, %{assigns: %{token: %Token{user: %User{} = user} = token}} = _conn) do
# if user.disclose_client do
# %{client_name: client_name, website: website} = Repo.preload(token, :app).app
# Map.put(params, :generator, %{type: "Application", name: client_name, url: website})
# else
# Map.put(params, :generator, nil)
# end
# end
defp put_application(params, _), do: Map.put(params, :generator, nil)
end
......@@ -358,6 +358,7 @@ test "posting a direct status", %{conn: conn} do
assert activity.data["cc"] == []
end
@tag :skip
test "discloses application metadata when enabled" do
user = insert(:user, disclose_client: true)
%{user: _user, token: token, conn: conn} = oauth_access(["write:statuses"], user: user)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment