TwitterAPI: Remove unused read notification function

This commit is contained in:
Haelwenn (lanodan) Monnier 2021-02-17 09:41:40 +01:00
parent a22c53810b
commit 65cd9cb638
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
1 changed files with 0 additions and 13 deletions

View File

@ -10,7 +10,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
alias Pleroma.Config alias Pleroma.Config
alias Pleroma.Emoji alias Pleroma.Emoji
alias Pleroma.Healthcheck alias Pleroma.Healthcheck
alias Pleroma.Notification
alias Pleroma.User alias Pleroma.User
alias Pleroma.Web.CommonAPI alias Pleroma.Web.CommonAPI
alias Pleroma.Web.Plugs.OAuthScopesPlug alias Pleroma.Web.Plugs.OAuthScopesPlug
@ -30,7 +29,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
] ]
) )
plug(OAuthScopesPlug, %{scopes: ["write:notifications"]} when action == :notifications_read)
def remote_subscribe(conn, %{"nickname" => nick, "profile" => _}) do def remote_subscribe(conn, %{"nickname" => nick, "profile" => _}) do
with %User{} = user <- User.get_cached_by_nickname(nick), with %User{} = user <- User.get_cached_by_nickname(nick),
@ -62,17 +60,6 @@ def remote_subscribe(conn, %{"user" => %{"nickname" => nick, "profile" => profil
end end
end end
def notifications_read(%{assigns: %{user: user}} = conn, %{"id" => notification_id}) do
with {:ok, _} <- Notification.read_one(user, notification_id) do
json(conn, %{status: "success"})
else
{:error, message} ->
conn
|> put_resp_content_type("application/json")
|> send_resp(403, Jason.encode!(%{"error" => message}))
end
end
def frontend_configurations(conn, _params) do def frontend_configurations(conn, _params) do
render(conn, "frontend_configurations.json") render(conn, "frontend_configurations.json")
end end