~edwargix/tallyard

73495915385c47b8fed3aba8e8c65d3c92ff5f7b — David Florness 2 years ago 59ee6db
Don't redact create events

These events don't contain anything that could jeopardize voters' ballots
1 files changed, 0 insertions(+), 13 deletions(-)

M election/voter.go
M election/voter.go => election/voter.go +0 -13
@@ 501,19 501,6 @@ func (el *Election) RedactEvents(client *mautrix.Client) {
		Reason: "election has concluded",
	}

	// redact the create/start events if we sent them
	if el.CreateEvt.Sender == el.LocalVoter.JoinEvt.Sender {
		_, err := client.RedactEvent(el.RoomID, el.CreateEvt.ID, reqRedact)
		if err != nil {
			panic(err)
		}
		// if we sent the create event, we necessarily sent the start event
		_, err = client.RedactEvent(el.RoomID, *el.StartID, reqRedact)
		if err != nil {
			panic(err)
		}
	}

	// redact our join event
	_, err := client.RedactEvent(el.RoomID, el.LocalVoter.JoinEvt.ID, reqRedact)
	if err != nil {