From b7f1de02794ab0ad60a8dd59e27fe5c2435dc8b6 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 21 Feb 2017 13:45:34 +0000 Subject: [PATCH] Explain what a StateAtEventAndReference is for --- src/github.com/matrix-org/dendrite/roomserver/types/types.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/roomserver/types/types.go b/src/github.com/matrix-org/dendrite/roomserver/types/types.go index e1f5e65cb..d99e146fc 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/types/types.go +++ b/src/github.com/matrix-org/dendrite/roomserver/types/types.go @@ -79,7 +79,10 @@ func (s StateAtEvent) IsStateEvent() bool { return s.EventStateKeyNID != 0 } -// StateAtEventAndReference ... +// StateAtEventAndReference is StateAtEvent and gomatrixserverlib.EventReference glued together. +// It is used when looking up the latest events in a room in the database. +// The gomatrixserverlib.EventReference is used to check whether a new event references the event. +// The StateAtEvent is used to construct the current state of the room from the latest events. type StateAtEventAndReference struct { StateAtEvent gomatrixserverlib.EventReference