From 3a5c0922e7d05adfbc72f38c22117a34ad685237 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 28 Aug 2020 16:40:41 +0100 Subject: [PATCH] Define Kind type --- roomserver/api/input.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roomserver/api/input.go b/roomserver/api/input.go index 05c981df4..7a26cb289 100644 --- a/roomserver/api/input.go +++ b/roomserver/api/input.go @@ -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.