mirror of
https://github.com/element-hq/dendrite.git
synced 2025-03-14 14:15:35 +00:00
Merge 253d7a9599
into c15dee80f2
This commit is contained in:
commit
a0a2931fa8
2 changed files with 11 additions and 2 deletions
|
@ -111,7 +111,7 @@ func (s *OutputRoomEventConsumer) onMessage(
|
|||
for _, msg := range msgs {
|
||||
// Only handle events we care about
|
||||
receivedType := api.OutputType(msg.Header.Get(jetstream.RoomEventType))
|
||||
if receivedType != api.OutputTypeNewRoomEvent && receivedType != api.OutputTypeNewInviteEvent {
|
||||
if receivedType != api.OutputTypeNewRoomEvent && receivedType != api.OutputTypeNewInviteEvent && receivedType != api.OutputTypeRedactedEvent {
|
||||
continue
|
||||
}
|
||||
// Parse out the event JSON
|
||||
|
@ -147,7 +147,11 @@ func (s *OutputRoomEventConsumer) onMessage(
|
|||
events = append(events, eventsRes.Events...)
|
||||
}
|
||||
}
|
||||
|
||||
case api.OutputTypeRedactedEvent:
|
||||
if output.RedactedEvent == nil || !s.appserviceIsInterestedInEvent(ctx, output.RedactedEvent.RedactedBecause, state.ApplicationService) {
|
||||
continue
|
||||
}
|
||||
events = append(events, output.RedactedEvent.RedactedBecause)
|
||||
default:
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -132,6 +132,11 @@ func (s *OutputRoomEventConsumer) onMessage(ctx context.Context, msgs []*nats.Ms
|
|||
s.onRetirePeek(s.ctx, *output.RetirePeek)
|
||||
case api.OutputTypeRedactedEvent:
|
||||
err = s.onRedactEvent(s.ctx, *output.RedactedEvent)
|
||||
if err == nil && s.asProducer != nil {
|
||||
if err = s.asProducer.ProduceRoomEvents(msg); err != nil {
|
||||
log.WithError(err).Warn("failed to produce OutputAppserviceEvent")
|
||||
}
|
||||
}
|
||||
case api.OutputTypePurgeRoom:
|
||||
err = s.onPurgeRoom(s.ctx, *output.PurgeRoom)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue