X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/b129b7cbc9fd9a9c11a77e5922861ef08893efa1..89e46a200bc05aabd8350ff2fb0df599cdc15ba3:/hotline/client.go 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