mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 06:53:09 -06:00
Review comments
This commit is contained in:
parent
5e19d9d340
commit
533e5dba5a
|
|
@ -66,6 +66,15 @@ type createRoomResponse struct {
|
|||
|
||||
// CreateRoom implements /createRoom
|
||||
func CreateRoom(req *http.Request) util.JSONResponse {
|
||||
serverName := "localhost"
|
||||
// TODO: Check room ID doesn't clash with an existing one, and we
|
||||
// probably shouldn't be using pseudo-random strings, maybe GUIDs?
|
||||
roomID := fmt.Sprintf("!%s:%s", util.RandomString(16), serverName)
|
||||
return createRoom(req, roomID)
|
||||
}
|
||||
|
||||
// createRoom implements /createRoom
|
||||
func createRoom(req *http.Request, roomID string) util.JSONResponse {
|
||||
logger := util.GetLogger(req.Context())
|
||||
userID, resErr := auth.VerifyAccessToken(req)
|
||||
if resErr != nil {
|
||||
|
|
@ -84,9 +93,6 @@ func CreateRoom(req *http.Request) util.JSONResponse {
|
|||
|
||||
// TODO: visibility/presets/raw initial state/creation content
|
||||
|
||||
serverName := "localhost"
|
||||
roomID := fmt.Sprintf("!%s:%s", util.RandomString(16), serverName)
|
||||
// TODO: Check room ID doesn't clash with an existing one
|
||||
// TODO: Create room alias association
|
||||
|
||||
logger.WithFields(log.Fields{
|
||||
|
|
|
|||
Loading…
Reference in a new issue