From 0a5d47140468856affa84b6a4c75eeec0e664071 Mon Sep 17 00:00:00 2001 From: Michael Jard Date: Sat, 21 May 2011 23:24:35 -0700 Subject: [PATCH] fix minor issue where bot tries to set its nick every 15 minutes, even if it has the wanted nick. --- irc.go | 1 + irc_callback.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/irc.go b/irc.go index 410aadd..e8c63f8 100644 --- a/irc.go +++ b/irc.go @@ -91,6 +91,7 @@ func pinger(i *IRCConnection) { i.SendRaw(fmt.Sprintf("PING %d", time.Nanoseconds())) //Try to recapture nickname if it's not as configured. if i.nick != i.nickcurrent { + i.nickcurrent = i.nick i.SendRaw(fmt.Sprintf("NICK %s", i.nick)) } } diff --git a/irc_callback.go b/irc_callback.go index 61592e2..018fec5 100644 --- a/irc_callback.go +++ b/irc_callback.go @@ -110,4 +110,8 @@ func (irc *IRCConnection) setupCallbacks() { irc.nickcurrent = e.Arguments[0] } }) + + irc.AddCallback("001", func(e *IRCEvent) { + irc.nickcurrent = e.Arguments[0] + }) }