fix minor issue where bot tries to set its nick every 15 minutes,

even if it has the wanted nick.
This commit is contained in:
Michael Jard 2011-05-21 23:24:35 -07:00
parent 78a4c71736
commit 0a5d471404
2 changed files with 5 additions and 0 deletions

1
irc.go
View File

@ -91,6 +91,7 @@ func pinger(i *IRCConnection) {
i.SendRaw(fmt.Sprintf("PING %d", time.Nanoseconds())) i.SendRaw(fmt.Sprintf("PING %d", time.Nanoseconds()))
//Try to recapture nickname if it's not as configured. //Try to recapture nickname if it's not as configured.
if i.nick != i.nickcurrent { if i.nick != i.nickcurrent {
i.nickcurrent = i.nick
i.SendRaw(fmt.Sprintf("NICK %s", i.nick)) i.SendRaw(fmt.Sprintf("NICK %s", i.nick))
} }
} }

View File

@ -110,4 +110,8 @@ func (irc *IRCConnection) setupCallbacks() {
irc.nickcurrent = e.Arguments[0] irc.nickcurrent = e.Arguments[0]
} }
}) })
irc.AddCallback("001", func(e *IRCEvent) {
irc.nickcurrent = e.Arguments[0]
})
} }