1
0
Fork 0
forked from Mirrors/gomuks

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,7 +18,7 @@ import (
) )
type Config struct { type Config struct {
OutputDir, MxPassword, KeyPath, KeyPassword, RecoveryPhrase string OutputDir, MxPassword, Homeserver, KeyPath, KeyPassword, RecoveryPhrase string
MxID id.UserID MxID id.UserID
} }
@ -43,12 +43,7 @@ func Init(conf Config, updates chan fmt.Stringer) error {
updates <- initializedGomuks{} updates <- initializedGomuks{}
// login section // login section
_, hs, err := conf.MxID.Parse() gmx.Config().HS = conf.Homeserver
if err != nil {
return err
}
gmx.Config().HS = hs
if err := gmx.Matrix().InitClient(false); err != nil { if err := gmx.Matrix().InitClient(false); err != nil {
return err return err
} else if err = gmx.Matrix().Login(conf.MxID.String(), conf.MxPassword); err != nil { } else if err = gmx.Matrix().Login(conf.MxID.String(), conf.MxPassword); err != nil {