mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-20 08:28:26 +00:00
Redirect to user feed instead of directly serving it.
This commit is contained in:
parent
1854842b09
commit
92a8944dfe
|
@ -4,8 +4,14 @@ defmodule Pleroma.Web.OStatus.OStatusController do
|
|||
alias Pleroma.{User, Activity}
|
||||
alias Pleroma.Web.OStatus.FeedRepresenter
|
||||
alias Pleroma.Repo
|
||||
alias Pleroma.Web.OStatus
|
||||
import Ecto.Query
|
||||
|
||||
def feed_redirect(conn, %{"nickname" => nickname}) do
|
||||
user = User.get_cached_by_nickname(nickname)
|
||||
redirect conn, external: OStatus.feed_path(user)
|
||||
end
|
||||
|
||||
def feed(conn, %{"nickname" => nickname}) do
|
||||
user = User.get_cached_by_nickname(nickname)
|
||||
query = from activity in Activity,
|
||||
|
|
|
@ -74,7 +74,7 @@ defmodule Pleroma.Web.Router do
|
|||
pipe_through :ostatus
|
||||
|
||||
get "/users/:nickname/feed", OStatus.OStatusController, :feed
|
||||
get "/users/:nickname", OStatus.OStatusController, :feed
|
||||
get "/users/:nickname", OStatus.OStatusController, :feed_redirect
|
||||
post "/users/:nickname/salmon", OStatus.OStatusController, :salmon_incoming
|
||||
post "/push/hub/:nickname", Websub.WebsubController, :websub_subscription_request
|
||||
get "/push/subscriptions/:id", Websub.WebsubController, :websub_subscription_confirmation
|
||||
|
|
|
@ -99,7 +99,7 @@ defmodule Pleroma.Web.Websub do
|
|||
|
||||
defp valid_topic(%{"hub.topic" => topic}, user) do
|
||||
if topic == OStatus.feed_path(user) do
|
||||
{:ok, topic}
|
||||
{:ok, OStatus.feed_path(user)}
|
||||
else
|
||||
{:error, "Wrong topic requested, expected #{OStatus.feed_path(user)}, got #{topic}"}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue