~edwargix/tallyard

0d62571bb7162daf40297b31ebcd387484af8b57 — David Florness 2 years ago bef3eba
Correctly include state events in sync timeline

I thought all states were exclusively returned via the state list.

See "Rationale" under https://spec.matrix.org/v1.2/client-server-api/#syncing
1 files changed, 10 insertions(+), 8 deletions(-)

M cmd/tallyard/syncer.go
M cmd/tallyard/syncer.go => cmd/tallyard/syncer.go +10 -8
@@ 36,6 36,12 @@ func NewTallyardSyncer() *TallyardSyncer {
}

func (s *TallyardSyncer) GetFilterJSON(userID id.UserID) *mautrix.Filter {
	stateEvtTypes := []event.Type{
		event.StateCreate,
		event.StateEncryption,
		event.StateMember,
		event.StateRoomName,
	}
	return &mautrix.Filter{
		AccountData: mautrix.FilterPart{
			NotTypes: []event.Type{event.NewEventType("*")},


@@ 51,24 57,20 @@ func (s *TallyardSyncer) GetFilterJSON(userID id.UserID) *mautrix.Filter {
				NotTypes: []event.Type{event.NewEventType("*")},
			},
			State: mautrix.FilterPart{
				Types: []event.Type{
					event.StateCreate,
					event.StateEncryption,
					event.StateMember,
					event.StateRoomName,
				},
				Types: stateEvtTypes,
			},
			Timeline: mautrix.FilterPart{
				// TODO figure out how to have no limit; -1 is giving me 500s
				Limit: 500,
				Types: []event.Type{
				Types: append(
					stateEvtTypes,
					election.CreateElectionMessage,
					election.JoinElectionMessage,
					election.StartElectionMessage,
					election.KeysMessage,
					election.EvalsMessage,
					election.SumMessage,
				},
				),
			},
		},
	}