Delegate headless homeserver to configuration

This commit is contained in:
FIGBERT 2023-08-09 13:31:04 -07:00
parent a55f78d628
commit f6f1a906d0
No known key found for this signature in database
GPG key ID: 67F1598D607A844B

View file

@ -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 {