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)