diff options
author | Runxi Yu <me@runxiyu.org> | 2024-12-08 08:52:23 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2024-12-08 08:52:23 +0800 |
commit | d201e74fff4e6d82d639d858826bdb4190936c07 (patch) | |
tree | 7e5de8e206bf913fc0bbef5eba81b06fa9c1e06c /cmd_ping.go | |
parent | Add basic command handling (diff) | |
download | meseircd-d201e74fff4e6d82d639d858826bdb4190936c07.tar.gz meseircd-d201e74fff4e6d82d639d858826bdb4190936c07.tar.zst meseircd-d201e74fff4e6d82d639d858826bdb4190936c07.zip |
Server and self awareness
Diffstat (limited to 'cmd_ping.go')
-rw-r--r-- | cmd_ping.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd_ping.go b/cmd_ping.go index 4ad07c5..c5442b5 100644 --- a/cmd_ping.go +++ b/cmd_ping.go @@ -4,10 +4,11 @@ func init() { commandHandlers["PING"] = handleClientPing } -func handleClientPing(msg RMsg, client *Client) (error) { +func handleClientPing(msg RMsg, client *Client) bool { if len(msg.Params) < 1 { - client.Send(SMsg{Command: ERR_NEEDMOREPARAMS, Params: []string{"PING", "Not enough parameters"}}) + client.Send(MakeMsg(self, ERR_NEEDMOREPARAMS, "PING", "Not enough parameters")) + return true } - client.Send(SMsg{Command: "PONG", Params: []string{msg.Params[0]}}) - return nil + client.Send(MakeMsg(self, "PONG", msg.Params[0])) + return true } |