This commit is contained in:
Richard van der Hoff 2017-09-25 19:13:33 +01:00
parent 3dd30858d1
commit d14fa3ca28

View file

@ -272,6 +272,9 @@ func (r joinRoomReq) joinRoomUsingServers(
// server was invalid this returns an error. // server was invalid this returns an error.
// Otherwise this returns a JSONResponse. // Otherwise this returns a JSONResponse.
func (r joinRoomReq) joinRoomUsingServer(roomID string, server gomatrixserverlib.ServerName) (*util.JSONResponse, error) { func (r joinRoomReq) joinRoomUsingServer(roomID string, server gomatrixserverlib.ServerName) (*util.JSONResponse, error) {
logger := util.GetLogger(r.req.Context())
logger.Debug("Doing make_join")
respMakeJoin, err := r.federation.MakeJoin(r.req.Context(), server, roomID, r.userID) respMakeJoin, err := r.federation.MakeJoin(r.req.Context(), server, roomID, r.userID)
if err != nil { if err != nil {
// TODO: Check if the user was not allowed to join the room. // TODO: Check if the user was not allowed to join the room.
@ -295,15 +298,18 @@ func (r joinRoomReq) joinRoomUsingServer(roomID string, server gomatrixserverlib
return &res, nil return &res, nil
} }
logger.Debug("Doing send_join")
respSendJoin, err := r.federation.SendJoin(r.req.Context(), server, event) respSendJoin, err := r.federation.SendJoin(r.req.Context(), server, event)
if err != nil { if err != nil {
return nil, err return nil, err
} }
logger.Debug("Checking send_join response")
if err = respSendJoin.Check(r.req.Context(), r.keyRing, event); err != nil { if err = respSendJoin.Check(r.req.Context(), r.keyRing, event); err != nil {
return nil, err return nil, err
} }
logger.Debug("Writing send_join response to room server")
if err = r.producer.SendEventWithState( if err = r.producer.SendEventWithState(
r.req.Context(), gomatrixserverlib.RespState(respSendJoin), event, r.req.Context(), gomatrixserverlib.RespState(respSendJoin), event,
); err != nil { ); err != nil {