aboutsummaryrefslogtreecommitdiff
path: root/hotline/client.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-09 13:56:29 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-09 14:05:15 -0700
commit9cf66aeafbcbb9237fedc2efc97cc2856eb60f7f (patch)
treec3139d8af2bd6ae106a1f619cad7d64f2ddea6db /hotline/client.go
parentb129b7cbc9fd9a9c11a77e5922861ef08893efa1 (diff)
Convert more bespoke methods to io.Reader/io.Writer interfaces
Diffstat (limited to 'hotline/client.go')
-rw-r--r--hotline/client.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/hotline/client.go b/hotline/client.go
index e056438..3969e26 100644
--- a/hotline/client.go
+++ b/hotline/client.go
@@ -405,11 +405,12 @@ func handleClientGetUserNameList(ctx context.Context, c *Client, t *Transaction)
// fields, but shxd sneaks in FieldChatSubject (115) so it's important to filter explicitly for the expected
// field type. Probably a good idea to do everywhere.
if bytes.Equal(field.ID, []byte{0x01, 0x2c}) {
- u, err := ReadUser(field.Data)
- if err != nil {
- return res, err
+ var user User
+ if _, err := user.Write(field.Data); err != nil {
+ return res, fmt.Errorf("unable to read user data: %w", err)
}
- users = append(users, *u)
+
+ users = append(users, user)
}
}
c.UserList = users