mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-05 23:52:46 +00:00
Move SendJoin logic to GMSL (#3084)
Moves the core matrix logic for handling the send_join endpoint over to gmsl.
This commit is contained in:
parent
027a9b8ce0
commit
2eae8dc489
6 changed files with 147 additions and 233 deletions
|
@ -331,14 +331,14 @@ func Setup(
|
|||
if err != nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: spec.BadJSON("Invalid UserID"),
|
||||
JSON: spec.InvalidParam("Invalid UserID"),
|
||||
}
|
||||
}
|
||||
roomID, err := spec.NewRoomID(vars["roomID"])
|
||||
if err != nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: spec.BadJSON("Invalid RoomID"),
|
||||
JSON: spec.InvalidParam("Invalid RoomID"),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -358,10 +358,17 @@ func Setup(
|
|||
JSON: spec.Forbidden("Forbidden by server ACLs"),
|
||||
}
|
||||
}
|
||||
roomID := vars["roomID"]
|
||||
eventID := vars["eventID"]
|
||||
roomID, err := spec.NewRoomID(vars["roomID"])
|
||||
if err != nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: spec.InvalidParam("Invalid RoomID"),
|
||||
}
|
||||
}
|
||||
|
||||
res := SendJoin(
|
||||
httpReq, request, cfg, rsAPI, keys, roomID, eventID,
|
||||
httpReq, request, cfg, rsAPI, keys, *roomID, eventID,
|
||||
)
|
||||
// not all responses get wrapped in [code, body]
|
||||
var body interface{}
|
||||
|
@ -390,10 +397,17 @@ func Setup(
|
|||
JSON: spec.Forbidden("Forbidden by server ACLs"),
|
||||
}
|
||||
}
|
||||
roomID := vars["roomID"]
|
||||
eventID := vars["eventID"]
|
||||
roomID, err := spec.NewRoomID(vars["roomID"])
|
||||
if err != nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: spec.InvalidParam("Invalid RoomID"),
|
||||
}
|
||||
}
|
||||
|
||||
return SendJoin(
|
||||
httpReq, request, cfg, rsAPI, keys, roomID, eventID,
|
||||
httpReq, request, cfg, rsAPI, keys, *roomID, eventID,
|
||||
)
|
||||
},
|
||||
)).Methods(http.MethodPut)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue