diff --git a/headless/headless.go b/headless/headless.go index 0b9a533..b02a212 100644 --- a/headless/headless.go +++ b/headless/headless.go @@ -8,7 +8,6 @@ import ( "maunium.net/go/mautrix" "maunium.net/go/mautrix/crypto" "maunium.net/go/mautrix/crypto/ssss" - "maunium.net/go/mautrix/id" "maunium.net/go/gomuks/config" "maunium.net/go/gomuks/initialize" @@ -17,8 +16,7 @@ import ( ) type Config struct { - OutputDir, MxPassword, Homeserver, KeyPath, KeyPassword, RecoveryCode string - MxID id.UserID + OutputDir, Session, Code, KeyPath, KeyPassword, RecoveryCode string } func Init(conf Config, updates chan fmt.Stringer) error { @@ -43,13 +41,13 @@ func Init(conf Config, updates chan fmt.Stringer) error { updates <- initializedGomuks{} // login section - gmx.Config().HS = conf.Homeserver + gmx.Config().HS = "https://matrix.beeper.com" if err := gmx.Matrix().InitClient(false); err != nil { return err - } else if err = gmx.Matrix().Login(conf.MxID.String(), conf.MxPassword); err != nil { + } else if err = gmx.Matrix().BeeperLogin(conf.Session, conf.Code); err != nil { return err } - updates <- loggedIn{account: conf.MxID} + updates <- loggedIn{} // key import data, err := os.ReadFile(conf.KeyPath) diff --git a/headless/msg.go b/headless/msg.go index ccf8d22..67cb9c7 100644 --- a/headless/msg.go +++ b/headless/msg.go @@ -14,10 +14,10 @@ func (msg initializedGomuks) String() string { return "Initialized gomuks…" } -type loggedIn struct{ account fmt.Stringer } +type loggedIn struct{} func (msg loggedIn) String() string { - return fmt.Sprintf("Logged in to %s…", msg.account) + return fmt.Sprintf("Logged in…") } type importedKeys struct{ imported, total int }