diff --git a/internal/websocket/send.go b/internal/websocket/send.go index 8bc905a..c3871b0 100644 --- a/internal/websocket/send.go +++ b/internal/websocket/send.go @@ -8,8 +8,8 @@ import ( GoTomato "git.smsvc.net/pomodoro/GoTomato/pkg/models" ) -// Sends to ClientCommand to the clients websocket -func (c Client) sendClientCommand(msg GoTomato.ClientCommand) { +// Sends a message to the clients websocket +func sendClientCommand(c Client, msg GoTomato.ClientCommand) { messageBytes, err := json.Marshal(msg) if err != nil { log.Error("Error marshalling!", "reason", err) @@ -30,7 +30,7 @@ func (c Client) SendCmd(cmd string) { Password: c.Password, } - c.sendClientCommand(message) + sendClientCommand(c, message) } // Sends the new PomodoroConfig to the server @@ -41,5 +41,5 @@ func (c Client) SendSettingsUpdate(settings GoTomato.PomodoroConfig) { Settings: settings, } - c.sendClientCommand(message) + sendClientCommand(c, message) }