diff --git a/src/github.com/matrix-org/dendrite/clientapi/producers/roomserver.go b/src/github.com/matrix-org/dendrite/clientapi/producers/roomserver.go index 5e4a1de7e..e50561a70 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/producers/roomserver.go +++ b/src/github.com/matrix-org/dendrite/clientapi/producers/roomserver.go @@ -55,10 +55,10 @@ func (c *RoomserverProducer) SendEvents( // with the state at the event as KindOutlier before it. func (c *RoomserverProducer) SendEventWithState( ctx context.Context, state gomatrixserverlib.RespState, event gomatrixserverlib.Event, -) (string, error) { +) error { outliers, err := state.Events() if err != nil { - return "", err + return err } ires := make([]api.InputRoomEvent, len(outliers)+1) @@ -83,7 +83,8 @@ func (c *RoomserverProducer) SendEventWithState( StateEventIDs: stateEventIDs, } - return c.SendInputRoomEvents(ctx, ires) + _, err = c.SendInputRoomEvents(ctx, ires) + return err } // SendInputRoomEvents writes the given input room events to the roomserver input API. diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/joinroom.go b/src/github.com/matrix-org/dendrite/clientapi/routing/joinroom.go index 036e48a57..fa8425ca1 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/joinroom.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/joinroom.go @@ -304,7 +304,7 @@ func (r joinRoomReq) joinRoomUsingServer(roomID string, server gomatrixserverlib return nil, err } - if _, err = r.producer.SendEventWithState( + if err = r.producer.SendEventWithState( r.req.Context(), gomatrixserverlib.RespState(respSendJoin), event, ); err != nil { res := httputil.LogThenError(r.req, err) diff --git a/src/github.com/matrix-org/dendrite/federationapi/routing/send.go b/src/github.com/matrix-org/dendrite/federationapi/routing/send.go index 50f991f09..eab248745 100644 --- a/src/github.com/matrix-org/dendrite/federationapi/routing/send.go +++ b/src/github.com/matrix-org/dendrite/federationapi/routing/send.go @@ -207,14 +207,13 @@ func (t *txnReq) processEventWithMissingState(e gomatrixserverlib.Event) error { return err } // Check that the returned state is valid. - if err = state.Check(t.context, t.keys); err != nil { + if err := state.Check(t.context, t.keys); err != nil { return err } // Check that the event is allowed by the state. - if err = checkAllowedByState(e, state.StateEvents); err != nil { + if err := checkAllowedByState(e, state.StateEvents); err != nil { return err } // pass the event along with the state to the roomserver - _, err = t.producer.SendEventWithState(t.context, state, e) - return err + return t.producer.SendEventWithState(t.context, state, e) }