From 0f5049279ce73f7d30c2a6818ee8b099b70ef4d9 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 17 Jan 2022 11:06:22 +0000 Subject: [PATCH] Clean up some commented out bits --- federationapi/routing/send.go | 39 +---------------------- roomserver/internal/input/input_events.go | 6 ---- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 9b7ac835..ae8457df 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -362,7 +362,7 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res } if c := len(results); c > 0 { - util.GetLogger(ctx).Infof("Processed %d PDUs from %v in transaction %q", c, t.Origin, t.TransactionID) + util.GetLogger(ctx).Debugf("Processed %d PDUs from %v in transaction %q", c, t.Origin, t.TransactionID) } return &gomatrixserverlib.RespSend{PDUs: results}, nil } @@ -563,43 +563,6 @@ func (t *txnReq) processDeviceListUpdate(ctx context.Context, e gomatrixserverli } func (t *txnReq) processEvent(_ context.Context, e *gomatrixserverlib.HeaderedEvent) error { - t.work = "" // reset from previous event - - /* - // Ask the roomserver if we know about the room and/or if we're joined - // to it. If we aren't then we won't bother processing the event. - joinedReq := api.QueryServerJoinedToRoomRequest{ - RoomID: e.RoomID(), - } - var joinedRes api.QueryServerJoinedToRoomResponse - if err := t.rsAPI.QueryServerJoinedToRoom(ctx, &joinedReq, &joinedRes); err != nil { - return fmt.Errorf("t.rsAPI.QueryServerJoinedToRoom: %w", err) - } - - if !joinedRes.RoomExists || !joinedRes.IsInRoom { - // We don't believe we're a member of this room, therefore there's - // no point in wasting work trying to figure out what to do with - // missing auth or prev events. Drop the event. - return roomNotFoundError{e.RoomID()} - } - - // Work out if the roomserver knows everything it needs to know to auth - // the event. This includes the prev_events and auth_events. - // NOTE! This is going to include prev_events that have an empty state - // snapshot. This is because we will need to re-request the event, and - // it's /state_ids, in order for it to exist in the roomserver correctly - // before the roomserver tries to work out - stateReq := api.QueryMissingAuthPrevEventsRequest{ - RoomID: e.RoomID(), - AuthEventIDs: nil, //e.AuthEventIDs(), - PrevEventIDs: nil, //e.PrevEventIDs(), - } - var stateResp api.QueryMissingAuthPrevEventsResponse - if err := t.rsAPI.QueryMissingAuthPrevEvents(ctx, &stateReq, &stateResp); err != nil { - return fmt.Errorf("t.rsAPI.QueryMissingAuthPrevEvents: %w", err) - } - */ - // pass the event to the roomserver which will do auth checks // If the event fail auth checks, gmsl.NotAllowed error will be returned which we be silently // discarded by the caller of this function diff --git a/roomserver/internal/input/input_events.go b/roomserver/internal/input/input_events.go index 4e982afc..2a40d268 100644 --- a/roomserver/internal/input/input_events.go +++ b/roomserver/internal/input/input_events.go @@ -83,12 +83,6 @@ func (r *Inputer) processRoomEvent( "type": event.Type(), }) - if input.Origin == "" { - // input.Origin = event.Origin() - } - - logger.Println("XXX: Processing event") - // if we have already got this event then do not process it again, if the input kind is an outlier. // Outliers contain no extra information which may warrant a re-processing. if input.Kind == api.KindOutlier {