X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/c74c1f28b3db3a02630a7c80d0b98838a025fd90..31658ca1e37cb8118a8a081e6d8f6e15e39a1cea:/hotline/transaction_handlers.go diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go index 26eee12..9edecb8 100644 --- a/hotline/transaction_handlers.go +++ b/hotline/transaction_handlers.go @@ -634,7 +634,7 @@ func HandleSetUser(cc *ClientConn, t *Transaction) (res []Transaction, err error if err != nil { return res, err } - if err := os.WriteFile(cc.Server.ConfigDir+"Users/"+login+".yaml", out, 0666); err != nil { + if err := os.WriteFile(filepath.Join(cc.Server.ConfigDir, "Users", login+".yaml"), out, 0666); err != nil { return res, err } @@ -698,8 +698,13 @@ func HandleListUsers(cc *ClientConn, t *Transaction) (res []Transaction, err err var userFields []Field for _, acc := range cc.Server.Accounts { - userField := acc.MarshalBinary() - userFields = append(userFields, NewField(fieldData, userField)) + b := make([]byte, 0, 100) + n, err := acc.Read(b) + if err != nil { + return res, err + } + + userFields = append(userFields, NewField(fieldData, b[:n])) } res = append(res, cc.NewReply(t, userFields...))