From 9af2f5f1f253a821cec660ef477c274d5cd13953 Mon Sep 17 00:00:00 2001 From: Kegsay Date: Thu, 27 Aug 2020 18:53:40 +0100 Subject: Remove device DB from clientapi (#1352) * Remove device DB from clientapi * Remove device DB from startup configuration It's all an impl detail now in user API --- clientapi/routing/routing.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'clientapi/routing/routing.go') diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index c259e529..f2494dc7 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -35,7 +35,6 @@ import ( roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts" - "github.com/matrix-org/dendrite/userapi/storage/devices" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" ) @@ -52,7 +51,6 @@ func Setup( rsAPI roomserverAPI.RoomserverInternalAPI, asAPI appserviceAPI.AppServiceQueryAPI, accountDB accounts.Database, - deviceDB devices.Database, userAPI userapi.UserInternalAPI, federation *gomatrixserverlib.FederationClient, syncProducer *producers.SyncAPIProducer, @@ -322,13 +320,13 @@ func Setup( r0mux.Handle("/logout", httputil.MakeAuthAPI("logout", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { - return Logout(req, deviceDB, device) + return Logout(req, userAPI, device) }), ).Methods(http.MethodPost, http.MethodOptions) r0mux.Handle("/logout/all", httputil.MakeAuthAPI("logout", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { - return LogoutAll(req, deviceDB, device) + return LogoutAll(req, userAPI, device) }), ).Methods(http.MethodPost, http.MethodOptions) @@ -632,7 +630,7 @@ func Setup( r0mux.Handle("/devices", httputil.MakeAuthAPI("get_devices", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { - return GetDevicesByLocalpart(req, deviceDB, device) + return GetDevicesByLocalpart(req, userAPI, device) }), ).Methods(http.MethodGet, http.MethodOptions) @@ -642,7 +640,7 @@ func Setup( if err != nil { return util.ErrorResponse(err) } - return GetDeviceByID(req, deviceDB, device, vars["deviceID"]) + return GetDeviceByID(req, userAPI, device, vars["deviceID"]) }), ).Methods(http.MethodGet, http.MethodOptions) -- cgit v1.2.3