mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-27 08:41:57 -06:00
Send output event for purge
This commit is contained in:
parent
4c4de0dfc6
commit
c45bf118a8
|
@ -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,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue