diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index ebe68218b..34652cdde 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -276,6 +276,7 @@ def user_fetcher(username) do get("/friendships/no_retweets/ids", TwitterAPI.Controller, :empty_array) get("/mutes/users/ids", TwitterAPI.Controller, :empty_array) + get("/qvitter/mutes", TwitterAPI.Controller, :raw_empty_array) get("/externalprofile/show", TwitterAPI.Controller, :external_profile) end diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index ff5921807..8f5b3c786 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -404,6 +404,10 @@ def empty_array(conn, _params) do json(conn, Jason.encode!([])) end + def raw_empty_array(conn, _params) do + json(conn, []) + end + def update_profile(%{assigns: %{user: user}} = conn, params) do params = if bio = params["description"] do diff --git a/test/web/twitter_api/twitter_api_controller_test.exs b/test/web/twitter_api/twitter_api_controller_test.exs index 806227110..3a035e298 100644 --- a/test/web/twitter_api/twitter_api_controller_test.exs +++ b/test/web/twitter_api/twitter_api_controller_test.exs @@ -491,6 +491,26 @@ test "with credentials", %{conn: conn, user: current_user} do end end + describe "GET /api/qvitter/mutes.json" do + setup [:valid_user] + + test "unimplemented mutes without valid credentials", %{conn: conn} do + conn = get(conn, "/api/qvitter/mutes.json") + assert json_response(conn, 403) == %{"error" => "Invalid credentials."} + end + + test "unimplemented mutes with credentials", %{conn: conn, user: current_user} do + conn = + conn + |> with_credentials(current_user.nickname, "test") + |> get("/api/qvitter/mutes.json") + + current_user = Repo.get(User, current_user.id) + + assert [] = json_response(conn, 200) + end + end + describe "POST /api/favorites/create/:id" do setup [:valid_user]