aboutsummaryrefslogtreecommitdiff
path: root/currentstateserver/consumers/roomserver.go
diff options
context:
space:
mode:
Diffstat (limited to 'currentstateserver/consumers/roomserver.go')
-rw-r--r--currentstateserver/consumers/roomserver.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/currentstateserver/consumers/roomserver.go b/currentstateserver/consumers/roomserver.go
index 9e2694b0..81878c6d 100644
--- a/currentstateserver/consumers/roomserver.go
+++ b/currentstateserver/consumers/roomserver.go
@@ -61,6 +61,8 @@ func (c *OutputRoomEventConsumer) onMessage(msg *sarama.ConsumerMessage) error {
return c.onNewRoomEvent(context.TODO(), *output.NewRoomEvent)
case api.OutputTypeNewInviteEvent:
case api.OutputTypeRetireInviteEvent:
+ case api.OutputTypeRedactedEvent:
+ return c.onRedactEvent(context.Background(), *output.RedactedEvent)
default:
log.WithField("type", output.Type).Debug(
"roomserver output log: ignoring unknown output type",
@@ -105,6 +107,12 @@ func (c *OutputRoomEventConsumer) onNewRoomEvent(
return nil
}
+func (c *OutputRoomEventConsumer) onRedactEvent(
+ ctx context.Context, msg api.OutputRedactedEvent,
+) error {
+ return c.db.RedactEvent(ctx, msg.RedactedEventID, msg.RedactedBecause)
+}
+
// Start consuming from room servers
func (c *OutputRoomEventConsumer) Start() error {
return c.rsConsumer.Start()