From c0299825c4f55656e3074bb68e5694ccd374053d Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Wed, 5 Oct 2022 11:05:11 +0200 Subject: [PATCH] Remove checks on SyncAPI consumer --- syncapi/consumers/roomserver.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/syncapi/consumers/roomserver.go b/syncapi/consumers/roomserver.go index 7d3156fba..c7a11dbb4 100644 --- a/syncapi/consumers/roomserver.go +++ b/syncapi/consumers/roomserver.go @@ -93,23 +93,6 @@ func (s *OutputRoomEventConsumer) Start() error { // sync stream position may race and be incorrectly calculated. func (s *OutputRoomEventConsumer) onMessage(ctx context.Context, msgs []*nats.Msg) bool { msg := msgs[0] // Guaranteed to exist if onMessage is called - - receivedType := api.OutputType(msg.Header.Get(jetstream.RoomEventType)) - ok := false - // Only handle events we care about - for _, eventType := range api.OutputTypes { - if receivedType == eventType { - ok = true - break - } - } - if !ok { - log.WithField("type", receivedType).Debug( - "roomserver output log: ignoring unknown output type", - ) - return true - } - // Parse out the event JSON var err error var output api.OutputEvent @@ -119,7 +102,7 @@ func (s *OutputRoomEventConsumer) onMessage(ctx context.Context, msgs []*nats.Ms return true } - switch receivedType { + switch output.Type { case api.OutputTypeNewRoomEvent: // Ignore redaction events. We will add them to the database when they are // validated (when we receive OutputTypeRedactedEvent)