Browse Source

send command processing errors to the originating session only

tags/v1.1.0-rc1
Shivaram Lingamneni 5 years ago
parent
commit
58d089020e
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      irc/client.go

+ 3
- 3
irc/client.go View File

388
 		if err == ircmsg.ErrorLineIsEmpty {
388
 		if err == ircmsg.ErrorLineIsEmpty {
389
 			continue
389
 			continue
390
 		} else if err == ircmsg.ErrorLineTooLong {
390
 		} else if err == ircmsg.ErrorLineTooLong {
391
-			client.Send(nil, client.server.name, ERR_INPUTTOOLONG, client.Nick(), client.t("Input line too long"))
391
+			session.Send(nil, client.server.name, ERR_INPUTTOOLONG, client.Nick(), client.t("Input line too long"))
392
 			continue
392
 			continue
393
 		} else if err != nil {
393
 		} else if err != nil {
394
 			client.Quit(client.t("Received malformed line"), session)
394
 			client.Quit(client.t("Received malformed line"), session)
398
 		cmd, exists := Commands[msg.Command]
398
 		cmd, exists := Commands[msg.Command]
399
 		if !exists {
399
 		if !exists {
400
 			if len(msg.Command) > 0 {
400
 			if len(msg.Command) > 0 {
401
-				client.Send(nil, client.server.name, ERR_UNKNOWNCOMMAND, client.Nick(), msg.Command, client.t("Unknown command"))
401
+				session.Send(nil, client.server.name, ERR_UNKNOWNCOMMAND, client.Nick(), msg.Command, client.t("Unknown command"))
402
 			} else {
402
 			} else {
403
-				client.Send(nil, client.server.name, ERR_UNKNOWNCOMMAND, client.Nick(), "lastcmd", client.t("No command given"))
403
+				session.Send(nil, client.server.name, ERR_UNKNOWNCOMMAND, client.Nick(), "lastcmd", client.t("No command given"))
404
 			}
404
 			}
405
 			continue
405
 			continue
406
 		}
406
 		}

Loading…
Cancel
Save