configure processing invites
This commit is contained in:
parent
168eb0a9d2
commit
73aea70f5c
|
@ -20,6 +20,7 @@ type MatrixConfig struct {
|
||||||
RoomID string
|
RoomID string
|
||||||
DBPath string
|
DBPath string
|
||||||
Pickle string
|
Pickle string
|
||||||
|
AcceptInvites bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type Matrix struct {
|
type Matrix struct {
|
||||||
|
@ -60,7 +61,9 @@ func (m *Matrix) Init() error {
|
||||||
}
|
}
|
||||||
m.client.Crypto = m.cryptoHelper
|
m.client.Crypto = m.cryptoHelper
|
||||||
|
|
||||||
m.AddEventHandler(m.InviteHandler())
|
if m.config.AcceptInvites {
|
||||||
|
m.AddEventHandler(m.InviteHandler())
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
1
main.go
1
main.go
|
@ -33,6 +33,7 @@ func main() {
|
||||||
RoomID: getParam("MATRIX_ROOM_ID", "!room:localhost"),
|
RoomID: getParam("MATRIX_ROOM_ID", "!room:localhost"),
|
||||||
DBPath: getParam("MATRIX_DB_PATH", "matrix.db"),
|
DBPath: getParam("MATRIX_DB_PATH", "matrix.db"),
|
||||||
Pickle: getParam("MATRIX_PICKLE", "matrix.pickle"),
|
Pickle: getParam("MATRIX_PICKLE", "matrix.pickle"),
|
||||||
|
AcceptInvites: getParam("MATRIX_ACCEPT_INVITES", "false") == "true",
|
||||||
}
|
}
|
||||||
mtrx := bot.NewMatrix(mtrxConf, mflx, logger)
|
mtrx := bot.NewMatrix(mtrxConf, mflx, logger)
|
||||||
if err := mtrx.Init(); err != nil {
|
if err := mtrx.Init(); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue