Revert "Merge branch 'notice-routes' into 'develop'"

This commit is contained in:
Sean King 2021-12-26 11:02:51 -07:00
parent 3b8eaadb0d
commit 8ef1d8b566
5 changed files with 0 additions and 67 deletions

View File

@ -19,7 +19,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Subscription(Bell) Notifications: Don't create from Pipeline Ingested replies
- Handle Reject for already-accepted Follows properly
- Display OpenGraph data on alternative notice routes.
### Removed

View File

@ -652,11 +652,6 @@ defmodule Pleroma.Web.Router do
get("/activities/:uuid", OStatus.OStatusController, :activity)
get("/notice/:id", OStatus.OStatusController, :notice)
# Notice compatibility routes for other frontends
get("/@:nickname/:id", OStatus.OStatusController, :notice)
get("/@:nickname/posts/:id", OStatus.OStatusController, :notice)
get("/:nickname/status/:id", OStatus.OStatusController, :notice)
# Mastodon compatibility routes
get("/users/:nickname/statuses/:id", OStatus.OStatusController, :object)
get("/users/:nickname/statuses/:id/activity", OStatus.OStatusController, :activity)

View File

@ -167,15 +167,6 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do
defp assign_id(%{path_info: ["notice", notice_id]} = conn, _opts),
do: assign(conn, :notice_id, notice_id)
defp assign_id(%{path_info: ["@" <> _nickname, notice_id]} = conn, _opts),
do: assign(conn, :notice_id, notice_id)
defp assign_id(%{path_info: ["@" <> _nickname, "posts", notice_id]} = conn, _opts),
do: assign(conn, :notice_id, notice_id)
defp assign_id(%{path_info: [_nickname, "status", notice_id]} = conn, _opts),
do: assign(conn, :notice_id, notice_id)
defp assign_id(%{path_info: ["users", user_id]} = conn, _opts),
do: assign(conn, :username_or_id, user_id)

View File

@ -343,54 +343,4 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do
|> response(200)
end
end
describe "notice compatibility routes" do
test "Soapbox FE", %{conn: conn} do
user = insert(:user)
note_activity = insert(:note_activity, user: user)
resp =
conn
|> put_req_header("accept", "text/html")
|> get("/@#{user.nickname}/posts/#{note_activity.id}")
|> response(200)
expected =
"<meta content=\"#{Endpoint.url()}/notice/#{note_activity.id}\" property=\"og:url\">"
assert resp =~ expected
end
test "Mastodon", %{conn: conn} do
user = insert(:user)
note_activity = insert(:note_activity, user: user)
resp =
conn
|> put_req_header("accept", "text/html")
|> get("/@#{user.nickname}/#{note_activity.id}")
|> response(200)
expected =
"<meta content=\"#{Endpoint.url()}/notice/#{note_activity.id}\" property=\"og:url\">"
assert resp =~ expected
end
test "Twitter", %{conn: conn} do
user = insert(:user)
note_activity = insert(:note_activity, user: user)
resp =
conn
|> put_req_header("accept", "text/html")
|> get("/#{user.nickname}/status/#{note_activity.id}")
|> response(200)
expected =
"<meta content=\"#{Endpoint.url()}/notice/#{note_activity.id}\" property=\"og:url\">"
assert resp =~ expected
end
end
end

View File

@ -86,8 +86,6 @@ defmodule Pleroma.Web.Plugs.FrontendStaticPlugTest do
"objects",
"activities",
"notice",
"@:nickname",
":nickname",
"users",
"tags",
"mailer",