Add comments

This commit is contained in:
Erik Johnston 2017-10-06 11:18:49 +01:00
parent fac81d3675
commit 64206fd2a3

View file

@ -120,6 +120,9 @@ type stateEventInStateResp struct {
// is publicly visible. Current behaviour is returning an empty array if the
// user cannot see the room's history.
func (rp *RequestPool) OnIncomingStateRequest(req *http.Request, roomID string) util.JSONResponse {
// TODO(#287): Auth request and handle the case where the user has left (where
// we should return the state at the poin they left)
stateEvents, err := rp.db.GetStateEventsForRoom(req.Context(), roomID)
if err != nil {
return httputil.LogThenError(req, err)
@ -161,6 +164,9 @@ func (rp *RequestPool) OnIncomingStateRequest(req *http.Request, roomID string)
// state to see if there is an event with that type and state key, if there
// is then (by default) we return the content, otherwise a 404.
func (rp *RequestPool) OnIncomingStateTypeRequest(req *http.Request, roomID string, evType, stateKey string) util.JSONResponse {
// TODO(#287): Auth request and handle the case where the user has left (where
// we should return the state at the poin they left)
logger := util.GetLogger(req.Context())
logger.WithFields(log.Fields{
"roomID": roomID,