diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-24 13:15:33 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-24 13:15:33 -0700 |
| commit | 926c7f5505456a0900e9c49f6c08efebe9a53505 (patch) | |
| tree | 9a568d2a838d1d05043a02b553ed5ddd029aff50 /hotline/transaction_handlers.go | |
| parent | 3178ae580a3fe97d6a1167b4346d209f04e9b7e3 (diff) | |
Implement io.Reader interface for account
Diffstat (limited to 'hotline/transaction_handlers.go')
| -rw-r--r-- | hotline/transaction_handlers.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go index 26eee12..650aae0 100644 --- a/hotline/transaction_handlers.go +++ b/hotline/transaction_handlers.go @@ -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...)) |