]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/client.go
patch: v0.10.24
[rbdr/mobius] / hotline / client.go
index e812d1dfa36a8ad013a375bd7673e0091170989f..35a70862e8da6c56401db6d4427070843f352e21 100644 (file)
@@ -580,8 +580,8 @@ func (c *Client) LogIn(login string, password string) error {
                        TranLogin, nil,
                        NewField(FieldUserName, []byte(c.Pref.Username)),
                        NewField(FieldUserIconID, c.Pref.IconBytes()),
-                       NewField(FieldUserLogin, negateString([]byte(login))),
-                       NewField(FieldUserPassword, negateString([]byte(password))),
+                       NewField(FieldUserLogin, encodeString([]byte(login))),
+                       NewField(FieldUserPassword, encodeString([]byte(password))),
                ),
        )
 }
@@ -625,7 +625,10 @@ func (c *Client) HandleTransaction(ctx context.Context, t *Transaction) error {
                        "IsReply", t.IsReply,
                        "type", binary.BigEndian.Uint16(t.Type),
                )
-               outT, _ := handler(ctx, c, t)
+               outT, err := handler(ctx, c, t)
+               if err != nil {
+                       c.Logger.Error("error handling transaction", "err", err)
+               }
                for _, t := range outT {
                        if err := c.Send(t); err != nil {
                                return err