diff options
-rw-r--r-- | roomserver/internal/input/input_latest_events.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/roomserver/internal/input/input_latest_events.go b/roomserver/internal/input/input_latest_events.go index 3608ef4b..9554bf33 100644 --- a/roomserver/internal/input/input_latest_events.go +++ b/roomserver/internal/input/input_latest_events.go @@ -285,15 +285,15 @@ func (u *latestEventsUpdater) calculateLatest( // then do nothing - it's not a candidate to be a new extremity if // it has been referenced. if _, ok := existingPrevs[newEvent.EventID()]; ok { + u.latest = oldLatest return false, nil } // If the "new" event is already a forward extremity then stop, as // nothing changes. - for _, event := range events { - if event.EventID() == newEvent.EventID() { - return false, nil - } + if _, ok := existingRefs[newEvent.EventID()]; ok { + u.latest = oldLatest + return false, nil } // Include our new event in the extremities. |