From 818bee77dd923ce3d04c72fa3c2bffb4757e9549 Mon Sep 17 00:00:00 2001 From: "." <.@.> Date: Sun, 8 May 2016 14:07:36 +1200 Subject: [PATCH] fix kill messages not being exposed in the client --HG-- branch : nmdc-ircfrontend --- TODO.txt | 3 --- server.go | 12 +++++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/TODO.txt b/TODO.txt index ef3e365..c8e2d39 100644 --- a/TODO.txt +++ b/TODO.txt @@ -30,9 +30,6 @@ WISHLIST - support SASL PLAIN authentication as well as just classic PASS -- KILL messages not being exposed in client(?) - 2016/05/07 22:51:33 <<< :Your nickname is already being used KILL A - REF diff --git a/server.go b/server.go index abfd7a6..d7475bd 100644 --- a/server.go +++ b/server.go @@ -320,7 +320,7 @@ func (s *Server) handleCommand(command string, args []string) { // Required for compatibility with Lite IRC, which sends USER/NICK in the wrong order } else { - s.reply(rplKill, "Can't change nicks on this server", "") + s.reply(rplKill, "Can't change nicks on this server.") s.DisconnectClient() } @@ -329,7 +329,7 @@ func (s *Server) handleCommand(command string, args []string) { // It's the final step in a PASS/NICK/USER login handshake. if s.clientState != CSUnregistered { - s.reply(rplKill, "You're already registered.", "") + s.reply(rplKill, "You're already registered.") s.DisconnectClient() return } @@ -404,11 +404,11 @@ func (s *Server) handleRegisteredCommand(command string, args []string) { case "0": // Quitting all channels? Drop client - s.reply(rplKill, "Bye.", "") + s.reply(rplKill, "Bye.") s.DisconnectClient() default: - s.reply(rplKill, "There is only '"+BLESSED_CHANNEL+"'.", "") + s.reply(rplKill, "There is only '"+BLESSED_CHANNEL+"'.") s.DisconnectClient() } @@ -693,8 +693,10 @@ func (s *Server) reply(code replyCode, args ...string) { case rplNickChange: s.writeClient(fmt.Sprintf(":%s NICK %s", args[0], args[1])) + case rplKill: - s.writeClient(fmt.Sprintf(":%s KILL %s A %s", args[0], s.clientNick(), args[1])) + s.writeClient(fmt.Sprintf(":%s KILL %s %s", s.name, s.clientNick(), args[0])) + // s.writeClient(fmt.Sprintf(":%s KILL %s A %s", args[0], s.clientNick(), args[1])) case rplMsg: for _, itm := range strings.Split(args[2], "\n") {