Skip to content
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

added fields to OnlineClient #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion server_cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,15 @@ type OnlineClient struct {
Type int `ms:"client_type"`
Away bool `ms:"client_away"`
AwayMessage string `ms:"client_away_message"`
Country string `ms:"client_country"`
InputMuted bool `ms:"client_input_muted"`
OutputMuted bool `ms:"client_output_muted"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add validation of the data to the tests.

}

// ClientList returns a list of online clients.
func (s *ServerMethods) ClientList() ([]*OnlineClient, error) {
var clients []*OnlineClient
if _, err := s.ExecCmd(NewCmd("clientlist").WithResponse(&clients)); err != nil {
if _, err := s.ExecCmd(NewCmd("clientlist -away -voice -country").WithResponse(&clients)); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these the only options or should they be configurable?

Also as they are optional is there a performance reason not to specify them all the time?

return nil, err
}
return clients, nil
Expand Down