From 423c656146579daac1e6739ef05b4b79f4c5b611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Behouba=20Manass=C3=A9?= Date: Wed, 22 Apr 2020 16:13:11 +0300 Subject: [PATCH] Response from /send_join now use gomatrixserverlib.RespSendJoin (#796) * response from /send_join now use gomatrixserverlib.RespSendJoin * Update Dendrite gomatrixserverlib version * Fix spelling Co-authored-by: Andrew Morgan Co-authored-by: Cnly Co-authored-by: Neil Alexander --- clientapi/routing/joinroom.go | 2 +- federationapi/routing/join.go | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/clientapi/routing/joinroom.go b/clientapi/routing/joinroom.go index f72bb916..d0dee7c2 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 e0678595..0c899ab9 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, }, } }