mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-22 14:21:55 -06:00
Move SetLatestEvents
call
This commit is contained in:
parent
350a5e5393
commit
d1f87e63f1
|
@ -178,6 +178,10 @@ func (u *latestEventsUpdater) doUpdateLatestEvents() error {
|
||||||
u.newStateNID = u.oldStateNID
|
u.newStateNID = u.oldStateNID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err = u.updater.SetLatestEvents(u.roomInfo.RoomNID, u.latest, u.stateAtEvent.EventNID, u.newStateNID); err != nil {
|
||||||
|
return fmt.Errorf("u.updater.SetLatestEvents: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
update, err := u.makeOutputNewRoomEvent()
|
update, err := u.makeOutputNewRoomEvent()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("u.makeOutputNewRoomEvent: %w", err)
|
return fmt.Errorf("u.makeOutputNewRoomEvent: %w", err)
|
||||||
|
@ -196,10 +200,6 @@ func (u *latestEventsUpdater) doUpdateLatestEvents() error {
|
||||||
return fmt.Errorf("u.api.WriteOutputEvents: %w", err)
|
return fmt.Errorf("u.api.WriteOutputEvents: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = u.updater.SetLatestEvents(u.roomInfo.RoomNID, u.latest, u.stateAtEvent.EventNID, u.newStateNID); err != nil {
|
|
||||||
return fmt.Errorf("u.updater.SetLatestEvents: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err = u.updater.MarkEventAsSent(u.stateAtEvent.EventNID); err != nil {
|
if err = u.updater.MarkEventAsSent(u.stateAtEvent.EventNID); err != nil {
|
||||||
return fmt.Errorf("u.updater.MarkEventAsSent: %w", err)
|
return fmt.Errorf("u.updater.MarkEventAsSent: %w", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue