forked from Mirrors/gomuks
Delegate headless homeserver to configuration
This commit is contained in:
parent
a55f78d628
commit
f6f1a906d0
1 changed files with 3 additions and 8 deletions
|
@ -18,8 +18,8 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
func Init(conf Config, updates chan fmt.Stringer) error {
|
func Init(conf Config, updates chan fmt.Stringer) error {
|
||||||
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue