Wire that up
This commit is contained in:
parent
53e218914d
commit
db9ca401b0
|
@ -440,10 +440,15 @@ func (s *OutputRoomEventConsumer) onPurgeRoom(
|
|||
ctx context.Context, req api.OutputPurgeRoom,
|
||||
) error {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
func (s *OutputRoomEventConsumer) updateStateEvent(event *gomatrixserverlib.HeaderedEvent) (*gomatrixserverlib.HeaderedEvent, error) {
|
||||
if event.StateKey() == nil {
|
||||
|
|
|
@ -75,6 +75,7 @@ type Database interface {
|
|||
// PurgeRoomState completely purges room state from the sync API. This is done when
|
||||
// receiving an output event that completely resets the state.
|
||||
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
|
||||
// If no event could be found, returns nil
|
||||
// If there was an issue during the retrieval, returns an error
|
||||
|
|
Loading…
Reference in a new issue