aboutsummaryrefslogtreecommitdiff
path: root/clientapi/routing/leaveroom.go
diff options
context:
space:
mode:
Diffstat (limited to 'clientapi/routing/leaveroom.go')
-rw-r--r--clientapi/routing/leaveroom.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/clientapi/routing/leaveroom.go b/clientapi/routing/leaveroom.go
index fbf14826..7e8c066e 100644
--- a/clientapi/routing/leaveroom.go
+++ b/clientapi/routing/leaveroom.go
@@ -29,10 +29,18 @@ func LeaveRoomByID(
rsAPI roomserverAPI.ClientRoomserverAPI,
roomID string,
) util.JSONResponse {
+ userID, err := spec.NewUserID(device.UserID, true)
+ if err != nil {
+ return util.JSONResponse{
+ Code: http.StatusBadRequest,
+ JSON: spec.Unknown("device userID is invalid"),
+ }
+ }
+
// Prepare to ask the roomserver to perform the room join.
leaveReq := roomserverAPI.PerformLeaveRequest{
RoomID: roomID,
- UserID: device.UserID,
+ Leaver: *userID,
}
leaveRes := roomserverAPI.PerformLeaveResponse{}