Matrix: Setup bot, add PIN verification

PIN is verified but not used currently. Works a little different than
the others, you input your matrix user ID and then the PIN is sent to
you. The bot doesn't support E2EE, so the bot being the first one to
message ensures the chat is unencrypted.
This commit is contained in:
Harvey Tindall
2021-05-29 17:43:11 +01:00
parent fb6256d1ed
commit e97b90d4d7
20 changed files with 446 additions and 22 deletions
+11
View File
@@ -100,6 +100,7 @@ type appContext struct {
email *Emailer
telegram *TelegramDaemon
discord *DiscordDaemon
matrix *MatrixDaemon
info, debug, err logger.Logger
host string
port int
@@ -590,6 +591,16 @@ func start(asDaemon, firstCall bool) {
defer app.discord.Shutdown()
}
}
if matrixEnabled {
app.matrix, err = newMatrixDaemon(app)
if err != nil {
app.err.Printf("Failed to initialize Matrix daemon: %v", err)
matrixEnabled = false
} else {
go app.matrix.run()
defer app.matrix.Shutdown()
}
}
} else {
debugMode = false
address = "0.0.0.0:8056"