Do not send game if one is not provided (instead of not sending game.name)

This commit is contained in:
Chris Rhodes 2015-12-29 10:35:00 -08:00
parent 974d5862a4
commit b5bfa454d0

View file

@ -60,12 +60,12 @@ func (s *Session) Handshake() (err error) {
} }
type updateStatusGame struct { type updateStatusGame struct {
Name *string `json:"name"` Name string `json:"name"`
} }
type updateStatusData struct { type updateStatusData struct {
IdleSince *int `json:"idle_since"` IdleSince *int `json:"idle_since"`
Game updateStatusGame `json:"game"` Game *updateStatusGame `json:"game"`
} }
type updateStatusOp struct { type updateStatusOp struct {
@ -83,7 +83,7 @@ func (s *Session) UpdateStatus(idle int, game string) (err error) {
usd.IdleSince = &idle usd.IdleSince = &idle
} }
if game != "" { if game != "" {
usd.Game.Name = &game usd.Game = &updateStatusGame{game}
} }
data := updateStatusOp{3, usd} data := updateStatusOp{3, usd}