diff options
author | Behouba Manassé <behouba@gmail.com> | 2020-04-22 16:13:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-22 14:13:11 +0100 |
commit | 423c656146579daac1e6739ef05b4b79f4c5b611 (patch) | |
tree | 03feceea444fe798bc703c830304f3454217811d | |
parent | a466e9e9cc86e04b4d28de45cd44199916664768 (diff) |
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 <andrew@amorgan.xyz>
Co-authored-by: Cnly <minecnly@gmail.com>
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
-rw-r--r-- | clientapi/routing/joinroom.go | 2 | ||||
-rw-r--r-- | 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, }, } } |