mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
Remove checks on SyncAPI consumer
This commit is contained in:
parent
6925e1f2d6
commit
c0299825c4
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue