From ed5f79c053e1a5e6724724a5131b7d8538921901 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 3 Apr 2012 21:01:10 +0200 Subject: [PATCH] Use ircutils.joinModes() instead of hacky str.join()s in ircmsgs.unbans. --- src/ircmsgs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ircmsgs.py b/src/ircmsgs.py index b5e50b4e5..27c8f2fc7 100644 --- a/src/ircmsgs.py +++ b/src/ircmsgs.py @@ -519,11 +519,13 @@ 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) + if msg and not prefix: + prefix = msg.prefix def kick(channel, nick, s='', prefix='', msg=None): """Returns a KICK to kick nick from channel with the message msg."""