Fix for bug #893264; we can now discover what channels require registration and only go after we've identified.

This commit is contained in:
Jeremy Fincher 2004-02-10 04:01:05 +00:00
parent d9f1c47fba
commit ac74ef9819
2 changed files with 17 additions and 9 deletions

View File

@ -173,7 +173,7 @@ class Services(privmsgs.CapabilityCheckingPrivmsg):
return
nick = self.registryValue('nick', irc.network)
self.log.debug('Notice received from NickServ: %r', msg)
s = msg.args[1]
s = msg.args[1].lower()
if self._ghosted(irc, s):
self.log.info('Received "GHOST succeeded" from NickServ')
self.sentGhost = False
@ -190,6 +190,9 @@ class Services(privmsgs.CapabilityCheckingPrivmsg):
self.identified = True
if self.channels:
irc.queueMsg(ircmsgs.joins(self.channels))
elif 'incorrect' in s:
log = 'Received "Password Incorrect" from NickServ.'
self.log.warning(log)
def getops(self, irc, msg, args):
"""[<channel>]

View File

@ -80,8 +80,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
def do471(self, irc, msg):
try:
channel = msg.args[1]
(irc, msg) = self.joins[channel]
del self.joins[channel]
(irc, msg) = self.joins.pop(channel)
irc.error('Cannot join %s, it\'s full.' % channel)
except KeyError:
self.log.debug('Got 471 without Admin.join being called.')
@ -89,8 +88,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
def do473(self, irc, msg):
try:
channel = msg.args[1]
(irc, msg) = self.joins[channel]
del self.joins[channel]
(irc, msg) = self.joins.pop(channel)
irc.error('Cannot join %s, I was not invited.' % channel)
except KeyError:
self.log.debug('Got 473 without Admin.join being called.')
@ -98,8 +96,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
def do474(self, irc, msg):
try:
channel = msg.args[1]
(irc, msg) = self.joins[channel]
del self.joins[channel]
(irc, msg) = self.joins.pop(channel)
irc.error('Cannot join %s, it\'s banned me.' % channel)
except KeyError:
self.log.debug('Got 474 without Admin.join being called.')
@ -107,12 +104,20 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
def do475(self, irc, msg):
try:
channel = msg.args[1]
(irc, msg) = self.joins[channel]
del self.joins[channel]
(irc, msg) = self.joins.pop(channel)
irc.error('Cannot join %s, my keyword was wrong.' % channel)
except KeyError:
self.log.debug('Got 475 without Admin.join being called.')
def do515(self, irc, msg):
try:
channel = msg.args[1]
(irc, msg) = self.joins.pop(channel)
irc.error('Cannot join %s, I\'m not identified with the nickserv.'
% channel)
except KeyError:
self.log.debug('Got 515 without Admin.join being called.')
def doJoin(self, irc, msg):
if msg.prefix == irc.prefix:
try: