From 58d089020e7c4676767cdcf13e332920b54abc51 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 15 May 2019 22:30:35 -0400 Subject: [PATCH] send command processing errors to the originating session only --- irc/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/irc/client.go b/irc/client.go index 8c38f378..3bd371ca 100644 --- a/irc/client.go +++ b/irc/client.go @@ -388,7 +388,7 @@ func (client *Client) run(session *Session) { if err == ircmsg.ErrorLineIsEmpty { continue } else if err == ircmsg.ErrorLineTooLong { - client.Send(nil, client.server.name, ERR_INPUTTOOLONG, client.Nick(), client.t("Input line too long")) + session.Send(nil, client.server.name, ERR_INPUTTOOLONG, client.Nick(), client.t("Input line too long")) continue } else if err != nil { client.Quit(client.t("Received malformed line"), session) @@ -398,9 +398,9 @@ func (client *Client) run(session *Session) { cmd, exists := Commands[msg.Command] if !exists { if len(msg.Command) > 0 { - client.Send(nil, client.server.name, ERR_UNKNOWNCOMMAND, client.Nick(), msg.Command, client.t("Unknown command")) + session.Send(nil, client.server.name, ERR_UNKNOWNCOMMAND, client.Nick(), msg.Command, client.t("Unknown command")) } else { - client.Send(nil, client.server.name, ERR_UNKNOWNCOMMAND, client.Nick(), "lastcmd", client.t("No command given")) + session.Send(nil, client.server.name, ERR_UNKNOWNCOMMAND, client.Nick(), "lastcmd", client.t("No command given")) } continue }