From c45bf118a8f470877f0a0205893d512e8f284231 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 22 Aug 2022 12:27:17 +0100 Subject: [PATCH] Send output event for purge --- roomserver/internal/perform/perform_admin.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/roomserver/internal/perform/perform_admin.go b/roomserver/internal/perform/perform_admin.go index 6de115c04..19f2493c9 100644 --- a/roomserver/internal/perform/perform_admin.go +++ b/roomserver/internal/perform/perform_admin.go @@ -28,6 +28,7 @@ import ( "github.com/matrix-org/dendrite/roomserver/storage" "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" + "github.com/sirupsen/logrus" ) type Admin struct { @@ -245,6 +246,9 @@ func (r *Admin) PerformAdminPurgeRoom( return nil } + logrus.WithField("room_id", req.RoomID).Warn("Purging room from roomserver") + defer logrus.WithField("room_id", req.RoomID).Warn("Room purged from roomserver") + if err := r.DB.PurgeRoom(ctx, req.RoomID); err != nil { res.Error = &api.PerformError{ Code: api.PerformErrorBadRequest, @@ -253,5 +257,12 @@ func (r *Admin) PerformAdminPurgeRoom( return nil } - return nil + return r.Inputer.OutputProducer.ProduceRoomEvents(req.RoomID, []api.OutputEvent{ + { + Type: api.OutputTypePurgeRoom, + PurgeRoom: &api.OutputPurgeRoom{ + RoomID: req.RoomID, + }, + }, + }) }