Use ircutils.joinModes() instead of hacky str.join()s in ircmsgs.unbans.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
Valentin Lorentz 2012-04-03 21:01:10 +02:00 committed by James McCoy
parent 741599c947
commit a630cc34d8

View File

@ -519,11 +519,11 @@ def unbans(channel, hostmasks, prefix='', msg=None):
if conf.supybot.protocols.irc.strictRfc():
assert isChannel(channel), repr(channel)
assert all(isUserHostmask, hostmasks), hostmasks
modes = [('-b', s) for s in hostmasks]
if msg and not prefix:
prefix = msg.prefix
return IrcMsg(prefix=prefix, command='MODE', msg=msg,
args=(channel, '-' + ('b'*len(hostmasks)),
' '.join(hostmasks)))
return IrcMsg(prefix=prefix, command='MODE',
args=[channel] + ircutils.joinModes(modes), msg=msg)
def kick(channel, nick, s='', prefix='', msg=None):
"""Returns a KICK to kick nick from channel with the message msg."""