aboutsummaryrefslogtreecommitdiff
path: root/roomserver/api/input.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-10-19 14:59:13 +0100
committerGitHub <noreply@github.com>2020-10-19 14:59:13 +0100
commit6e63df1d9a3eadf924d518a1a02f04dfd03ad6b1 (patch)
treefdfab85a07f37c18b0545f042a8e70dedc1aa75b /roomserver/api/input.go
parent0974f6e2c055d8d06b5ea9c175252b22b2399fe2 (diff)
KindOld (#1531)
* Add KindOld * Don't process latest events/memberships for old events * Allow federationsender to ignore duplicate key entries when LatestEventIDs is duplicated by RS output events * Signal to downstream components if an event has become a forward extremity * Don't exclude from sync * Soft-fail checks on KindNew * Don't run the latest events updater at all for KindOld * Don't make federation sender change after all * Kind in federation sender join * Don't send isForwardExtremity * Fix syncapi * Update comments * Fix SendEventWithState * Update sytest-whitelist * Generate old output events * Sync API consumes old room events * Update comments
Diffstat (limited to 'roomserver/api/input.go')
-rw-r--r--roomserver/api/input.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/roomserver/api/input.go b/roomserver/api/input.go
index dd693203..e1a8afa0 100644
--- a/roomserver/api/input.go
+++ b/roomserver/api/input.go
@@ -21,17 +21,25 @@ 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
+ // have a copy of. New events will influence the fwd extremities
+ // of the room and output events will be generated as a result.
+ KindNew
+ // KindOld event extend the graph backwards, or fill gaps in
+ // history. They may or may not include state. They will not be
+ // considered for forward extremities, and output events will NOT
+ // be generated for them.
+ KindOld
)
// DoNotSendToOtherServers tells us not to send the event to other matrix
@@ -43,7 +51,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.