diff --git a/server/irc.go b/server/irc.go index 6213e3d9..f4da1639 100644 --- a/server/irc.go +++ b/server/irc.go @@ -12,6 +12,13 @@ import ( func createNickInUseHandler(i *irc.Client, session *Session) func(string) string { return func(nick string) string { newNick := nick + "_" + + if newNick == i.GetNick() { + session.sendJSON("nick_fail", NickFail{ + Server: i.Host, + }) + } + session.printError("Nickname", nick, "is already in use, using", newNick, "instead") return newNick diff --git a/server/irc_handler.go b/server/irc_handler.go index 36247f05..a0bc61db 100644 --- a/server/irc_handler.go +++ b/server/irc_handler.go @@ -371,5 +371,5 @@ func formatIRCError(msg *irc.Message) string { } func printMessage(msg *irc.Message, i *irc.Client) { - log.Println(i.GetNick()+":", msg.Prefix, msg.Command, msg.Params, msg.LastParam()) + log.Println(i.GetNick()+":", msg.Prefix, msg.Command, msg.Params) }