From 7c508319a57f3ba50ddae03dc72aa83d1cd044cf Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 11 Feb 2021 14:19:53 -0600 Subject: [PATCH] Prefer naming this put_application because we're putting it into the params map --- .../web/mastodon_api/controllers/status_controller.ex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex index 6eb518684..a54357f93 100644 --- a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex @@ -140,7 +140,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do when not is_nil(scheduled_at) do params = Map.put(params, :in_reply_to_status_id, params[:in_reply_to_id]) - |> add_application(conn) + |> put_application(conn) attrs = %{ params: Map.new(params, fn {key, value} -> {to_string(key), value} end), @@ -169,7 +169,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do ) do params = Map.put(params, :in_reply_to_status_id, params[:in_reply_to_id]) - |> add_application(conn) + |> put_application(conn) with {:ok, activity} <- CommonAPI.post(user, params) do try_render(conn, "show.json", @@ -422,9 +422,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do ) end - defp add_application(params, %{assigns: %{token: %{app_id: app_id}}} = _conn) do + defp put_application(params, %{assigns: %{token: %{app_id: app_id}}} = _conn) do params |> Map.put(:application, Pleroma.Web.OAuth.App.get_app_by_id(app_id)) end - defp add_application(params, _), do: Map.put(params, :application, %{name: "Web", website: nil}) + defp put_application(params, _), do: Map.put(params, :application, %{name: "Web", website: nil}) end -- 2.45.2