Add toggle to only send to verified devices

This commit is contained in:
Tulir Asokan
2020-07-25 20:54:32 +03:00
parent ead7e0bf1d
commit ee3594db46
7 changed files with 42 additions and 15 deletions

View File

@ -55,7 +55,9 @@ func (c *Container) initCrypto() error {
if err != nil {
return errors.Wrap(err, "failed to open crypto store")
}
c.crypto = crypto.NewOlmMachine(c.client, cryptoLogger{}, cryptoStore, c.config.Rooms)
crypt := crypto.NewOlmMachine(c.client, cryptoLogger{}, cryptoStore, c.config.Rooms)
crypt.AllowUnverifiedDevices = !c.config.SendToVerifiedOnly
c.crypto = crypt
err = c.crypto.Load()
if err != nil {
return errors.Wrap(err, "failed to create olm machine")