X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Frouter.ex;h=ae799b8ac36650112f23e7756d0cf475754557a0;hb=e8843974cb9b8adfe8798bb8f7ff17b7a92f5ab8;hp=cc6bcfa1a368a66e94da63094460758137c204c6;hpb=64095961fe490029886cae358683532ea65bf2c0;p=akkoma diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index cc6bcfa1a..ae799b8ac 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -212,6 +212,7 @@ defmodule Pleroma.Web.Router do post("/main/ostatus", UtilController, :remote_subscribe) get("/ostatus_subscribe", UtilController, :remote_follow) + post("/ostatus_subscribe", UtilController, :do_remote_follow) end @@ -290,7 +291,6 @@ defmodule Pleroma.Web.Router do scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do pipe_through(:api) - get("/accounts/:id/scrobbles", ScrobbleController, :user_scrobbles) end @@ -305,14 +305,14 @@ defmodule Pleroma.Web.Router do get("/accounts/:id/identity_proofs", MastodonAPIController, :empty_array) get("/follow_requests", FollowRequestController, :index) - get("/blocks", MastodonAPIController, :blocks) - get("/mutes", MastodonAPIController, :mutes) + get("/blocks", AccountController, :blocks) + get("/mutes", AccountController, :mutes) get("/timelines/home", TimelineController, :home) get("/timelines/direct", TimelineController, :direct) - get("/favourites", MastodonAPIController, :favourites) - get("/bookmarks", MastodonAPIController, :bookmarks) + get("/favourites", StatusController, :favourites) + get("/bookmarks", StatusController, :bookmarks) get("/notifications", NotificationController, :index) get("/notifications/:id", NotificationController, :show) @@ -331,7 +331,7 @@ defmodule Pleroma.Web.Router do get("/filters", FilterController, :index) - get("/suggestions", MastodonAPIController, :suggestions) + get("/suggestions", SuggestionController, :index) get("/conversations", ConversationController, :index) post("/conversations/:id/read", ConversationController, :read) @@ -357,10 +357,10 @@ defmodule Pleroma.Web.Router do put("/scheduled_statuses/:id", ScheduledActivityController, :update) delete("/scheduled_statuses/:id", ScheduledActivityController, :delete) - post("/polls/:id/votes", MastodonAPIController, :poll_vote) + post("/polls/:id/votes", PollController, :vote) - post("/media", MastodonAPIController, :upload) - put("/media/:id", MastodonAPIController, :update_media) + post("/media", MediaController, :create) + put("/media/:id", MediaController, :update) delete("/lists/:id", ListController, :delete) post("/lists", ListController, :create) @@ -376,9 +376,7 @@ defmodule Pleroma.Web.Router do post("/reports", ReportController, :create) - # To do: POST /api/v1/follows is not present in Mastodon - consider removing - post("/follows", MastodonAPIController, :follows) - + post("/follows", AccountController, :follows) post("/accounts/:id/follow", AccountController, :follow) post("/accounts/:id/unfollow", AccountController, :unfollow) post("/accounts/:id/block", AccountController, :block) @@ -398,31 +396,31 @@ defmodule Pleroma.Web.Router do delete("/push/subscription", SubscriptionController, :delete) end - scope "/api/web", Pleroma.Web.MastodonAPI do + scope "/api/web", Pleroma.Web do pipe_through(:authenticated_api) - put("/settings", MastodonAPIController, :put_settings) + put("/settings", MastoFEController, :put_settings) end scope "/api/v1", Pleroma.Web.MastodonAPI do pipe_through(:api) post("/accounts", AccountController, :create) + get("/accounts/search", SearchController, :account_search) - get("/instance", MastodonAPIController, :masto_instance) - get("/instance/peers", MastodonAPIController, :peers) - post("/apps", MastodonAPIController, :create_app) - get("/apps/verify_credentials", MastodonAPIController, :verify_app_credentials) - get("/custom_emojis", MastodonAPIController, :custom_emojis) + get("/instance", InstanceController, :show) + get("/instance/peers", InstanceController, :peers) - get("/statuses/:id/card", StatusController, :card) + post("/apps", AppController, :create) + get("/apps/verify_credentials", AppController, :verify_credentials) + get("/statuses/:id/card", StatusController, :card) get("/statuses/:id/favourited_by", StatusController, :favourited_by) get("/statuses/:id/reblogged_by", StatusController, :reblogged_by) - get("/trends", MastodonAPIController, :empty_array) + get("/custom_emojis", CustomEmojiController, :index) - get("/accounts/search", SearchController, :account_search) + get("/trends", MastodonAPIController, :empty_array) get("/timelines/public", TimelineController, :public) get("/timelines/tag/:tag", TimelineController, :hashtag) @@ -432,7 +430,7 @@ defmodule Pleroma.Web.Router do get("/statuses/:id", StatusController, :show) get("/statuses/:id/context", StatusController, :context) - get("/polls/:id", MastodonAPIController, :get_poll) + get("/polls/:id", PollController, :show) get("/accounts/:id/statuses", AccountController, :statuses) get("/accounts/:id/followers", AccountController, :followers) @@ -497,8 +495,9 @@ defmodule Pleroma.Web.Router do get("/activities/:uuid", OStatus.OStatusController, :activity) get("/notice/:id", OStatus.OStatusController, :notice) get("/notice/:id/embed_player", OStatus.OStatusController, :notice_player) - get("/users/:nickname/feed", OStatus.OStatusController, :feed) - get("/users/:nickname", OStatus.OStatusController, :feed_redirect) + + get("/users/:nickname/feed", Feed.FeedController, :feed) + get("/users/:nickname", Feed.FeedController, :feed_redirect) post("/users/:nickname/salmon", OStatus.OStatusController, :salmon_incoming) post("/push/hub/:nickname", Websub.WebsubController, :websub_subscription_request) @@ -519,7 +518,6 @@ defmodule Pleroma.Web.Router do pipe_through(:ostatus) get("/users/:nickname/outbox", ActivityPubController, :outbox) - get("/objects/:uuid/likes", ActivityPubController, :object_likes) end pipeline :activitypub_client do @@ -588,15 +586,15 @@ defmodule Pleroma.Web.Router do get("/:version", Nodeinfo.NodeinfoController, :nodeinfo) end - scope "/", Pleroma.Web.MastodonAPI do + scope "/", Pleroma.Web do pipe_through(:mastodon_html) - get("/web/login", MastodonAPIController, :login) - delete("/auth/sign_out", MastodonAPIController, :logout) + get("/web/login", MastodonAPI.AuthController, :login) + delete("/auth/sign_out", MastodonAPI.AuthController, :logout) - post("/auth/password", MastodonAPIController, :password_reset) + post("/auth/password", MastodonAPI.AuthController, :password_reset) - get("/web/*path", MastodonAPIController, :index) + get("/web/*path", MastoFEController, :index) end pipeline :remote_media do