Better nick recapture

This commit is contained in:
tj
2011-02-03 01:16:13 +01:00
parent cf4e9f829a
commit ea8495857e
3 changed files with 19 additions and 8 deletions

4
irc.go
View File

@@ -88,6 +88,10 @@ func pinger(i *IRCConnection) {
case <-i.ticker2:
//Ping every 15 minutes.
i.SendRaw(fmt.Sprintf("PING %d", time.Nanoseconds()))
//Try to recapture nickname if it's not as configured.
if i.nick != i.nickcurrent {
i.SendRaw(fmt.Sprintf("NICK %s", i.nick))
}
}
}
}