more comments

This commit is contained in:
Mark Haines 2017-08-08 16:12:02 +01:00
parent 0768166cd7
commit 4ffc180c68

View file

@ -78,21 +78,29 @@ func updateLatestEvents(
// The state could be passed using function arguments, but it becomes impractical // The state could be passed using function arguments, but it becomes impractical
// when there are so many variables to pass around. // when there are so many variables to pass around.
type latestEventsUpdater struct { type latestEventsUpdater struct {
db RoomEventDatabase db RoomEventDatabase
updater types.RoomRecentEventsUpdater updater types.RoomRecentEventsUpdater
ow OutputRoomEventWriter ow OutputRoomEventWriter
roomNID types.RoomNID roomNID types.RoomNID
stateAtEvent types.StateAtEvent stateAtEvent types.StateAtEvent
event gomatrixserverlib.Event event gomatrixserverlib.Event
sendAsServer string // Which server to send this event as.
lastEventIDSent string sendAsServer string
latest []types.StateAtEventAndReference // The eventID of the event that was processed before this one.
removed []types.StateEntry lastEventIDSent string
added []types.StateEntry // The latest events in the room after processing this event.
latest []types.StateAtEventAndReference
// The state entries removed from and added to the current state of the
// room as a result of processing this event. They are sorted lists.
removed []types.StateEntry
added []types.StateEntry
// The state entries that are removed and added to recover the state before
// the event being processed. They are sorted lists.
stateBeforeEventRemoves []types.StateEntry stateBeforeEventRemoves []types.StateEntry
stateBeforeEventAdds []types.StateEntry stateBeforeEventAdds []types.StateEntry
oldStateNID types.StateSnapshotNID // The snapshots of current state before and after processing this event
newStateNID types.StateSnapshotNID oldStateNID types.StateSnapshotNID
newStateNID types.StateSnapshotNID
} }
func (u *latestEventsUpdater) doUpdateLatestEvents() error { func (u *latestEventsUpdater) doUpdateLatestEvents() error {