mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-03-03 17:03:10 -06:00
Revert changes to room updater
This commit is contained in:
parent
d6de8d2a6f
commit
b4dbd24da5
|
|
@ -15,6 +15,7 @@ type RoomUpdater struct {
|
||||||
roomInfo *types.RoomInfo
|
roomInfo *types.RoomInfo
|
||||||
latestEvents []types.StateAtEventAndReference
|
latestEvents []types.StateAtEventAndReference
|
||||||
lastEventIDSent string
|
lastEventIDSent string
|
||||||
|
currentStateSnapshotNID types.StateSnapshotNID
|
||||||
roomExists bool
|
roomExists bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,11 +34,11 @@ func NewRoomUpdater(ctx context.Context, d *Database, txn *sql.Tx, roomInfo *typ
|
||||||
// succeed, processing a create event which creates the room, or it won't.
|
// succeed, processing a create event which creates the room, or it won't.
|
||||||
if roomInfo == nil {
|
if roomInfo == nil {
|
||||||
return &RoomUpdater{
|
return &RoomUpdater{
|
||||||
transaction{ctx, txn}, d, nil, nil, "", false,
|
transaction{ctx, txn}, d, nil, nil, "", 0, false,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
eventNIDs, lastEventNIDSent, _, err :=
|
eventNIDs, lastEventNIDSent, currentStateSnapshotNID, err :=
|
||||||
d.RoomsTable.SelectLatestEventsNIDsForUpdate(ctx, txn, roomInfo.RoomNID)
|
d.RoomsTable.SelectLatestEventsNIDsForUpdate(ctx, txn, roomInfo.RoomNID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
rollback(txn)
|
rollback(txn)
|
||||||
|
|
@ -57,7 +58,7 @@ func NewRoomUpdater(ctx context.Context, d *Database, txn *sql.Tx, roomInfo *typ
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &RoomUpdater{
|
return &RoomUpdater{
|
||||||
transaction{ctx, txn}, d, roomInfo, stateAndRefs, lastEventIDSent, true,
|
transaction{ctx, txn}, d, roomInfo, stateAndRefs, lastEventIDSent, currentStateSnapshotNID, true,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,7 +100,7 @@ func (u *RoomUpdater) LastEventIDSent() string {
|
||||||
|
|
||||||
// CurrentStateSnapshotNID implements types.RoomRecentEventsUpdater
|
// CurrentStateSnapshotNID implements types.RoomRecentEventsUpdater
|
||||||
func (u *RoomUpdater) CurrentStateSnapshotNID() types.StateSnapshotNID {
|
func (u *RoomUpdater) CurrentStateSnapshotNID() types.StateSnapshotNID {
|
||||||
return u.roomInfo.StateSnapshotNID()
|
return u.currentStateSnapshotNID
|
||||||
}
|
}
|
||||||
|
|
||||||
// StorePreviousEvents implements types.RoomRecentEventsUpdater - This must be called from a Writer
|
// StorePreviousEvents implements types.RoomRecentEventsUpdater - This must be called from a Writer
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue