-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Raw sending of status (Rich Presence and Online Status) #462
Conversation
Doesn't do it on save because Gogland removed it and their new thing I can't make sense of.
wsapi.go
Outdated
// UpdateOnlineStatus is used to update the user's online status | ||
// If idle>0 and status=="online" then set status to idle | ||
// If otherwise, set status to the given value and no game | ||
func (s *Session) UpdateOnlineStatus(status string, afk bool, idle int) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to bother with this now.
wsapi.go
Outdated
// If game!="" then set game | ||
// If game!="" and url!="" then set the status type to streaming with the URL set. | ||
// If otherwise, set status to the given value and no game | ||
func (s *Session) UpdateOnlineStreamingStatus(status string, afk bool, idle int, game string, url string) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this either, or at least make this private.
This reverts commit 235cd15.
structs.go
Outdated
Type GameType `json:"type"` | ||
URL string `json:"url,omitempty"` | ||
Name string `json:"name"` | ||
Type int `json:"type"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change Type back to GameType, changing to int is an api change.
wsapi.go
Outdated
@@ -276,7 +276,7 @@ func (s *Session) UpdateStreamingStatus(idle int, game string, url string) (err | |||
return ErrWSNotFound |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this block into UpdateStatusComplex, it should be thread safe too! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I think you missed this, we should move the RLock/wsConn check to UpdateStatusComplex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sorry I missed that.
wsapi.go
Outdated
@@ -291,11 +291,16 @@ func (s *Session) UpdateStreamingStatus(idle int, game string, url string) (err | |||
} | |||
usd.Game = &Game{ | |||
Name: game, | |||
Type: gameType, | |||
Type: int(gameType), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be needed.
Oops, my apologies, looks like we need the cast when creating the Game, but we should keep the API as using GameType. |
Thanks so much for this <3 |
…marrin#462) * Added ability to change the online status * Add structs for rick presence implementation * Refractor and publicise UpdateStatusData * Add UpdateStatusComplex for raw status data sending * Case gameType to int, stopped it compiling * Might want to gofmt. Doesn't do it on save because Gogland removed it and their new thing I can't make sense of. * Revert "Added ability to change the online status" This reverts commit 235cd15. * Change gametypeto match * Move RLock to UpdateStatusComplex
@ikkerens had his cloned and Rich Presence was implemented on top of this.