From f3c3f657dca7b148acb48b273b5818e73c171bb2 Mon Sep 17 00:00:00 2001 From: David Florness Date: Fri, 31 Dec 2021 20:20:56 -0600 Subject: [PATCH] Send human-readable event on election creation --- ui/tui.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ui/tui.go b/ui/tui.go index b6c9584..8c9ebac 100644 --- a/ui/tui.go +++ b/ui/tui.go @@ -264,10 +264,21 @@ func RoomTUI(kill <-chan error, client *mautrix.Client, room *election.Room, ele if err != nil { return } + err = el.JoinElection(client, electionsMap.EventStore) if err != nil { return } + + body := fmt.Sprintf("Let's vote on:\n\n%s\n\n", title) + for _, candidate := range candidates { + body += fmt.Sprintf("- %s\n", candidate) + } + body += fmt.Sprintf("\n see tallyard.xyz for joining instructions") + _, err = client.SendMessageEvent(room.ID, event.EventMessage, event.MessageEventContent{ + MsgType: event.MsgNotice, + Body: body, + }) }) app.SetRoot(list, true) -- 2.38.4