diff options
author | Kegsay <kegan@matrix.org> | 2020-09-04 15:58:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 15:58:30 +0100 |
commit | 088294ee655282a32f7a418307408291f4299565 (patch) | |
tree | 2e3cabce42b85e4523d60096d0fa28f9cea5ae63 /clientapi | |
parent | 5076925c184998414c3691e97fc21b554abf4a55 (diff) |
Remove QueryRoomsForUser from current state server (#1398)
Diffstat (limited to 'clientapi')
-rw-r--r-- | clientapi/routing/memberships.go | 7 | ||||
-rw-r--r-- | clientapi/routing/profile.go | 8 | ||||
-rw-r--r-- | clientapi/routing/routing.go | 2 |
3 files changed, 8 insertions, 9 deletions
diff --git a/clientapi/routing/memberships.go b/clientapi/routing/memberships.go index 56059350..61348487 100644 --- a/clientapi/routing/memberships.go +++ b/clientapi/routing/memberships.go @@ -19,7 +19,6 @@ import ( "net/http" "github.com/matrix-org/dendrite/clientapi/jsonerror" - currentstateAPI "github.com/matrix-org/dendrite/currentstateserver/api" "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" userapi "github.com/matrix-org/dendrite/userapi/api" @@ -94,10 +93,10 @@ func GetMemberships( func GetJoinedRooms( req *http.Request, device *userapi.Device, - stateAPI currentstateAPI.CurrentStateInternalAPI, + rsAPI api.RoomserverInternalAPI, ) util.JSONResponse { - var res currentstateAPI.QueryRoomsForUserResponse - err := stateAPI.QueryRoomsForUser(req.Context(), ¤tstateAPI.QueryRoomsForUserRequest{ + var res api.QueryRoomsForUserResponse + err := rsAPI.QueryRoomsForUser(req.Context(), &api.QueryRoomsForUserRequest{ UserID: device.UserID, WantMembership: "join", }, &res) diff --git a/clientapi/routing/profile.go b/clientapi/routing/profile.go index bc51b0b5..5dd44ca2 100644 --- a/clientapi/routing/profile.go +++ b/clientapi/routing/profile.go @@ -140,8 +140,8 @@ func SetAvatarURL( return jsonerror.InternalServerError() } - var res currentstateAPI.QueryRoomsForUserResponse - err = stateAPI.QueryRoomsForUser(req.Context(), ¤tstateAPI.QueryRoomsForUserRequest{ + var res api.QueryRoomsForUserResponse + err = rsAPI.QueryRoomsForUser(req.Context(), &api.QueryRoomsForUserRequest{ UserID: device.UserID, WantMembership: "join", }, &res) @@ -258,8 +258,8 @@ func SetDisplayName( return jsonerror.InternalServerError() } - var res currentstateAPI.QueryRoomsForUserResponse - err = stateAPI.QueryRoomsForUser(req.Context(), ¤tstateAPI.QueryRoomsForUserRequest{ + var res api.QueryRoomsForUserResponse + err = rsAPI.QueryRoomsForUser(req.Context(), &api.QueryRoomsForUserRequest{ UserID: device.UserID, WantMembership: "join", }, &res) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index b29fccf2..0445852d 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -107,7 +107,7 @@ func Setup( ).Methods(http.MethodPost, http.MethodOptions) r0mux.Handle("/joined_rooms", httputil.MakeAuthAPI("joined_rooms", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { - return GetJoinedRooms(req, device, stateAPI) + return GetJoinedRooms(req, device, rsAPI) }), ).Methods(http.MethodGet, http.MethodOptions) r0mux.Handle("/rooms/{roomID}/join", |