Define Kind type

This commit is contained in:
Neil Alexander 2020-08-28 16:40:41 +01:00
parent 737802fc06
commit 3a5c0922e7
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -19,20 +19,22 @@ import (
"github.com/matrix-org/gomatrixserverlib"
)
type Kind int
const (
// KindOutlier event fall outside the contiguous event graph.
// We do not have the state for these events.
// These events are state events used to authenticate other events.
// They can become part of the contiguous event graph via backfill.
KindOutlier = 1
KindOutlier Kind = iota + 1
// KindNew event extend the contiguous graph going forwards.
// They usually don't need state, but may include state if the
// there was a new event that references an event that we don't
// have a copy of.
KindNew = 2
KindNew
// KindBackfill event extend the contiguous graph going backwards.
// They always have state.
KindBackfill = 3
KindBackfill
)
// DoNotSendToOtherServers tells us not to send the event to other matrix
@ -44,7 +46,7 @@ const DoNotSendToOtherServers = ""
type InputRoomEvent struct {
// Whether this event is new, backfilled or an outlier.
// This controls how the event is processed.
Kind int `json:"kind"`
Kind Kind `json:"kind"`
// The event JSON for the event to add.
Event gomatrixserverlib.HeaderedEvent `json:"event"`
// List of state event IDs that authenticate this event.