Made Admin.part properly remove the channel from the list of channels to join.

This commit is contained in:
Jeremy Fincher 2004-02-10 03:23:50 +00:00
parent abf56c909f
commit dd66098e3e

View File

@ -122,12 +122,12 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
self.log.debug(s) self.log.debug(s)
def doInvite(self, irc, msg): def doInvite(self, irc, msg):
if msg.args[1] not in irc.state.channels: channel = msg.args[1]
if conf.supybot.alwaysJoinOnInvite(): if channel not in irc.state.channels:
irc.queueMsg(ircmsgs.join(msg.args[1])) if conf.supybot.alwaysJoinOnInvite() or \
else: ircdb.checkCapability(msg.prefix, 'admin'):
if ircdb.checkCapability(msg.prefix, 'admin'): irc.queueMsg(ircmsgs.join(channel))
irc.queueMsg(ircmsgs.join(msg.args[1])) conf.supybot.channels().append(channel)
def join(self, irc, msg, args): def join(self, irc, msg, args):
"""<channel>[,<key>] [<channel>[,<key>] ...] """<channel>[,<key>] [<channel>[,<key>] ...]
@ -199,8 +199,10 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
irc.error('I\'m not currently in %s' % arg) irc.error('I\'m not currently in %s' % arg)
return return
for arg in args: for arg in args:
if arg in conf.supybot.channels(): for channelWithPass in conf.supybot.channels():
conf.supybot.channels().remove(arg) channel = channelWithPass.split(',')[0]
if arg == channel:
conf.supybot.channels().remove(channelWithPass)
irc.queueMsg(ircmsgs.parts(args, msg.nick)) irc.queueMsg(ircmsgs.parts(args, msg.nick))
def disable(self, irc, msg, args): def disable(self, irc, msg, args):