From f6f1a906d0f96a34e10dc3b07c53d013affff753 Mon Sep 17 00:00:00 2001 From: FIGBERT Date: Wed, 9 Aug 2023 13:31:04 -0700 Subject: [PATCH] Delegate headless homeserver to configuration --- headless/headless.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/headless/headless.go b/headless/headless.go index 95bff5a..71b365a 100644 --- a/headless/headless.go +++ b/headless/headless.go @@ -18,8 +18,8 @@ import ( ) type Config struct { - OutputDir, MxPassword, KeyPath, KeyPassword, RecoveryPhrase string - MxID id.UserID + OutputDir, MxPassword, Homeserver, KeyPath, KeyPassword, RecoveryPhrase string + MxID id.UserID } func Init(conf Config, updates chan fmt.Stringer) error { @@ -43,12 +43,7 @@ func Init(conf Config, updates chan fmt.Stringer) error { updates <- initializedGomuks{} // login section - _, hs, err := conf.MxID.Parse() - if err != nil { - return err - } - - gmx.Config().HS = hs + gmx.Config().HS = conf.Homeserver if err := gmx.Matrix().InitClient(false); err != nil { return err } else if err = gmx.Matrix().Login(conf.MxID.String(), conf.MxPassword); err != nil {