]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/client.go
patch: v0.5.2
[rbdr/mobius] / hotline / client.go
index 4ca42f38669eef3829ddaf8a804917d1cd108220..367656027ebacaf475d4242f0527fd08d92ef13d 100644 (file)
@@ -10,7 +10,7 @@ import (
        "github.com/rivo/tview"
        "github.com/stretchr/testify/mock"
        "go.uber.org/zap"
-       "gopkg.in/yaml.v2"
+       "gopkg.in/yaml.v3"
        "math/big"
        "math/rand"
        "net"
@@ -61,7 +61,6 @@ func readConfig(cfgPath string) (*ClientPrefs, error) {
 
        prefs := ClientPrefs{}
        decoder := yaml.NewDecoder(fh)
-       decoder.SetStrict(true)
        if err := decoder.Decode(&prefs); err != nil {
                return nil, err
        }
@@ -104,8 +103,7 @@ func NewClient(cfgPath string, logger *zap.SugaredLogger) *Client {
 
        prefs, err := readConfig(cfgPath)
        if err != nil {
-               fmt.Printf("unable to read config file %s", cfgPath)
-               os.Exit(1)
+               logger.Fatal(fmt.Sprintf("unable to read config file %s\n", cfgPath))
        }
        c.pref = prefs
 
@@ -635,7 +633,6 @@ func (c *Client) LogIn(login string, password string) error {
                        NewField(fieldUserIconID, c.pref.IconBytes()),
                        NewField(fieldUserLogin, negateString([]byte(login))),
                        NewField(fieldUserPassword, negateString([]byte(password))),
-                       NewField(fieldVersion, []byte{0, 2}),
                ),
        )
 }