aboutsummaryrefslogtreecommitdiff
path: root/cmd_ping.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-12-08 10:32:29 +0800
committerRunxi Yu <me@runxiyu.org>2024-12-08 10:32:29 +0800
commit6bbe00f0c7aae6c468b1a3e12983a74a170e92b8 (patch)
tree970b43288cdbb8c05cf5df2aaaf79e94019d13af /cmd_ping.go
parentRemove another unnecessary anonymous function (diff)
downloadmeseircd-6bbe00f0c7aae6c468b1a3e12983a74a170e92b8.tar.gz
meseircd-6bbe00f0c7aae6c468b1a3e12983a74a170e92b8.tar.zst
meseircd-6bbe00f0c7aae6c468b1a3e12983a74a170e92b8.zip
Handle send failures
Diffstat (limited to 'cmd_ping.go')
-rw-r--r--cmd_ping.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/cmd_ping.go b/cmd_ping.go
index dc7131f..9da4ee9 100644
--- a/cmd_ping.go
+++ b/cmd_ping.go
@@ -4,11 +4,9 @@ func init() {
commandHandlers["PING"] = handleClientPing
}
-func handleClientPing(msg RMsg, client *Client) bool {
+func handleClientPing(msg RMsg, client *Client) error {
if len(msg.Params) < 1 {
- client.Send(MakeMsg(self, ERR_NEEDMOREPARAMS, "PING", "Not enough parameters"))
- return true
+ return client.Send(MakeMsg(self, ERR_NEEDMOREPARAMS, "PING", "Not enough parameters"))
}
- client.Send(MakeMsg(self, "PONG", self.Name, msg.Params[0]))
- return true
+ return client.Send(MakeMsg(self, "PONG", self.Name, msg.Params[0]))
}