Send nick_fail if the new nick is in use and the padded nick is the same as the old one
This commit is contained in:
parent
403f7d0942
commit
ae6ad0a5b9
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user