diff --git a/clientapi/routing/joinroom.go b/clientapi/routing/joinroom.go index f72bb9162..d0dee7c2a 100644 --- a/clientapi/routing/joinroom.go +++ b/clientapi/routing/joinroom.go @@ -386,7 +386,7 @@ func (r joinRoomReq) joinRoomUsingServer(roomID string, server gomatrixserverlib if err = r.producer.SendEventWithState( r.req.Context(), - gomatrixserverlib.RespState(respSendJoin.RespState), + respSendJoin.ToRespState(), event.Headered(respMakeJoin.RoomVersion), ); err != nil { util.GetLogger(r.req.Context()).WithError(err).Error("r.producer.SendEventWithState") diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go index e06785954..0c899ab9f 100644 --- a/federationapi/routing/join.go +++ b/federationapi/routing/join.go @@ -252,9 +252,12 @@ func SendJoin( return util.JSONResponse{ Code: http.StatusOK, - JSON: map[string]interface{}{ - "state": gomatrixserverlib.UnwrapEventHeaders(stateAndAuthChainResponse.StateEvents), - "auth_chain": gomatrixserverlib.UnwrapEventHeaders(stateAndAuthChainResponse.AuthChainEvents), + JSON: gomatrixserverlib.RespSendJoin{ + RespState: gomatrixserverlib.RespState{ + StateEvents: gomatrixserverlib.UnwrapEventHeaders(stateAndAuthChainResponse.StateEvents), + AuthEvents: gomatrixserverlib.UnwrapEventHeaders(stateAndAuthChainResponse.AuthChainEvents), + }, + Origin: cfg.Matrix.ServerName, }, } }