From fe2c0be29c0637c83dc81d70e217bb9cb8f3ea64 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 21 Feb 2017 13:56:25 +0000 Subject: [PATCH] More comments on the latest events --- .../matrix-org/dendrite/roomserver/input/latest_events.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/github.com/matrix-org/dendrite/roomserver/input/latest_events.go b/src/github.com/matrix-org/dendrite/roomserver/input/latest_events.go index 69c5dade8..5982f2fb0 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/input/latest_events.go +++ b/src/github.com/matrix-org/dendrite/roomserver/input/latest_events.go @@ -41,6 +41,8 @@ func updateLatestEvents( for _, prevEvent := range prevEvents { if l.EventID == prevEvent.EventID && bytes.Compare(l.EventSHA256, prevEvent.EventSHA256) == 0 { // This event can be removed from the latest events cause we've found an event that references it. + // (If an event is referenced by another event then it can't be one of the latest events in the room + // because we have an event that comes after it) continue } // Keep the event in the latest events.