Browse Source

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

Chris Rhodes 9 years ago
parent
commit
b5bfa454d0
1 changed files with 4 additions and 4 deletions
  1. 4 4
      wsapi.go

+ 4 - 4
wsapi.go

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