Explain and condense end of SendMembership

This commit is contained in:
Andrew Morgan 2019-07-12 10:14:39 +01:00
parent 0872c1ba4b
commit 313dd397f7

View file

@ -99,18 +99,18 @@ func SendMembership(
return httputil.LogThenError(req, err) return httputil.LogThenError(req, err)
} }
var returnData interface{} = struct{}{}
// The join membership requires the room id to be sent in the response
if membership == "join" { if membership == "join" {
return util.JSONResponse{ returnData = struct {
Code: http.StatusOK, RoomID string `json:"room_id"`
JSON: struct { }{roomID}
RoomID string `json:"room_id"`
}{roomID},
}
} }
return util.JSONResponse{ return util.JSONResponse{
Code: http.StatusOK, Code: http.StatusOK,
JSON: struct{}{}, JSON: returnData,
} }
} }