diff --git a/plugins/Services.py b/plugins/Services.py index 4bc64377c..833a14434 100644 --- a/plugins/Services.py +++ b/plugins/Services.py @@ -69,7 +69,6 @@ class Services(privmsgs.CapabilityCheckingPrivmsg): self.reset() def reset(self): - self.got376 = False self.sentGhost = False self.identified = False @@ -124,7 +123,6 @@ class Services(privmsgs.CapabilityCheckingPrivmsg): self.sentGhost = False def do376(self, irc, msg): - self.got376 = True if self.nickserv: # Check to see if we're started. assert self.nick, 'Services: Nick must not be empty.' if irc.nick == self.nick: @@ -136,7 +134,7 @@ class Services(privmsgs.CapabilityCheckingPrivmsg): do422 = do377 = do376 def do433(self, irc, msg): - if self.nickserv and self.got376: + if self.nickserv and irc.afterConnect: self._doGhost(irc) else: self.log.warning('do433 called without plugin being started.') diff --git a/src/irclib.py b/src/irclib.py index c510f9408..71223a4c8 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -420,7 +420,7 @@ class Irc(IrcCommandDispatcher): self._nickmods = copy.copy(conf.nickmods) self.lastTake = 0 self.server = None - self.got376 = False + self.afterConnect = False self.fastqueue = smallqueue() self.lastping = time.time() self.outstandingPing = False @@ -437,7 +437,7 @@ class Irc(IrcCommandDispatcher): self.state.reset() self.queue.reset() self.server = None - self.got376 = False + self.afterConnect = False self.lastping = time.time() self.outstandingPing = False self.fastqueue = queue() @@ -491,7 +491,7 @@ class Irc(IrcCommandDispatcher): else: self.lastTake = now msg = self.queue.dequeue() - elif now > (self.lastping + conf.pingInterval) and self.got376: + elif now > (self.lastping + conf.pingInterval) and self.afterConnect: if self.outstandingPing: s = 'Reconnecting to %s, ping not replied to.' % self.server log.warning(s) @@ -552,7 +552,8 @@ class Irc(IrcCommandDispatcher): self.outstandingPing = False def do376(self, msg): - self.got376 = True + self.afterConnect = True + do377 = do422 = do376 def do433(self, msg): """Handles 'nickname already in use' messages."""