Wire that up
This commit is contained in:
parent
53e218914d
commit
db9ca401b0
|
@ -440,9 +440,14 @@ func (s *OutputRoomEventConsumer) onPurgeRoom(
|
||||||
ctx context.Context, req api.OutputPurgeRoom,
|
ctx context.Context, req api.OutputPurgeRoom,
|
||||||
) error {
|
) error {
|
||||||
logrus.WithField("room_id", req.RoomID).Warn("Purging room from sync API")
|
logrus.WithField("room_id", req.RoomID).Warn("Purging room from sync API")
|
||||||
defer logrus.WithField("room_id", req.RoomID).Warn("Room purged from sync API")
|
|
||||||
|
|
||||||
|
if err := s.db.PurgeRoom(ctx, req.RoomID); err != nil {
|
||||||
|
logrus.WithField("room_id", req.RoomID).WithError(err).Error("Failed to purge room from sync API")
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
logrus.WithField("room_id", req.RoomID).Warn("Room purged from sync API")
|
||||||
return nil
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *OutputRoomEventConsumer) updateStateEvent(event *gomatrixserverlib.HeaderedEvent) (*gomatrixserverlib.HeaderedEvent, error) {
|
func (s *OutputRoomEventConsumer) updateStateEvent(event *gomatrixserverlib.HeaderedEvent) (*gomatrixserverlib.HeaderedEvent, error) {
|
||||||
|
|
|
@ -75,6 +75,7 @@ type Database interface {
|
||||||
// PurgeRoomState completely purges room state from the sync API. This is done when
|
// PurgeRoomState completely purges room state from the sync API. This is done when
|
||||||
// receiving an output event that completely resets the state.
|
// receiving an output event that completely resets the state.
|
||||||
PurgeRoomState(ctx context.Context, roomID string) error
|
PurgeRoomState(ctx context.Context, roomID string) error
|
||||||
|
PurgeRoom(ctx context.Context, roomID string) error
|
||||||
// GetStateEvent returns the Matrix state event of a given type for a given room with a given state key
|
// GetStateEvent returns the Matrix state event of a given type for a given room with a given state key
|
||||||
// If no event could be found, returns nil
|
// If no event could be found, returns nil
|
||||||
// If there was an issue during the retrieval, returns an error
|
// If there was an issue during the retrieval, returns an error
|
||||||
|
|
Loading…
Reference in a new issue