diff --git a/lib/architex_web/client/controllers/info_controller.ex b/lib/architex_web/client/controllers/info_controller.ex index c90743d..c049db3 100644 --- a/lib/architex_web/client/controllers/info_controller.ex +++ b/lib/architex_web/client/controllers/info_controller.ex @@ -21,4 +21,25 @@ defmodule ArchitexWeb.Client.InfoController do def unrecognized(conn, _params) do put_error(conn, :unrecognized) end + + @doc """ + Gets information about the server's supported feature set and other relevant capabilities. + + Action for GET /_matrix/client/r0/capabilities. + """ + def capabilities(conn, _params) do + data = %{ + capabilities: %{ + "m.change_password": %{enabled: false}, + "m.room_versions": %{ + default: "5", + available: %{"5": "stable"} + } + } + } + + conn + |> put_status(200) + |> json(data) + end end diff --git a/lib/architex_web/router.ex b/lib/architex_web/router.ex index b0f3f82..015d0f2 100644 --- a/lib/architex_web/router.ex +++ b/lib/architex_web/router.ex @@ -53,6 +53,7 @@ defmodule ArchitexWeb.Router do post "/logout/all", AccountController, :logout_all post "/createRoom", RoomController, :create get "/joined_rooms", RoomController, :joined_rooms + get "/capabilities", InfoController, :capabilities scope "/directory" do put "/room/:alias", AliasesController, :create