From 20a01bceb2869c810932eac217d96dc221953685 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 16 Nov 2020 15:44:53 +0000 Subject: =?UTF-8?q?Pass=20pointers=20to=20events=20=E2=80=94=20reloaded=20?= =?UTF-8?q?(#1583)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Pass events as pointers * Fix lint errors * Update gomatrixserverlib * Update gomatrixserverlib * Update to matrix-org/gomatrixserverlib#240 --- clientapi/routing/sendevent.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clientapi/routing/sendevent.go') diff --git a/clientapi/routing/sendevent.go b/clientapi/routing/sendevent.go index 1303663f..a4240cf3 100644 --- a/clientapi/routing/sendevent.go +++ b/clientapi/routing/sendevent.go @@ -93,7 +93,7 @@ func SendEvent( if err := api.SendEvents( req.Context(), rsAPI, api.KindNew, - []gomatrixserverlib.HeaderedEvent{ + []*gomatrixserverlib.HeaderedEvent{ e.Headered(verRes.RoomVersion), }, cfg.Matrix.ServerName, @@ -189,7 +189,7 @@ func generateSendEvent( // check to see if this user can perform this operation stateEvents := make([]*gomatrixserverlib.Event, len(queryRes.StateEvents)) for i := range queryRes.StateEvents { - stateEvents[i] = &queryRes.StateEvents[i].Event + stateEvents[i] = queryRes.StateEvents[i].Event } provider := gomatrixserverlib.NewAuthEvents(stateEvents) if err = gomatrixserverlib.Allowed(e.Event, &provider); err != nil { @@ -198,5 +198,5 @@ func generateSendEvent( JSON: jsonerror.Forbidden(err.Error()), // TODO: Is this error string comprehensible to the client? } } - return &e.Event, nil + return e.Event, nil } -- cgit v1.2.3