From f943fee5d50c8025dbcaa5d6ad7f3390ce99de67 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 9 Jul 2011 13:44:16 +0200 Subject: [PATCH] Protector: unban user before inviting him. Closes GH-69. --- plugins/Protector/plugin.py | 8 +++++++- src/version.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/Protector/plugin.py b/plugins/Protector/plugin.py index 0e2a0e6cb..5e99e5637 100644 --- a/plugins/Protector/plugin.py +++ b/plugins/Protector/plugin.py @@ -143,8 +143,14 @@ class Protector(callbacks.Plugin): if self.isProtected(irc, channel, hostmask): self.log.info('%s was kicked from %s and is protected; ' 'inviting back.', hostmask, channel) - irc.queueMsg(ircmsgs.invite(nick, channel)) + hostmask = '%s!%s' % (nick, irc.state.nickToHostmask(nick)) protected.append(nick) + bans = [] + for banmask in irc.state.channels[channel].bans: + if ircutils.hostmaskPatternEqual(banmask, hostmask): + bans.append(banmask) + irc.queueMsg(ircmsgs.unbans(channel, bans)) + irc.queueMsg(ircmsgs.invite(nick, channel)) if not self.isOp(irc, channel, msg.prefix): self.demote(irc, channel, msg.nick) diff --git a/src/version.py b/src/version.py index a7445bac0..30121aea8 100644 --- a/src/version.py +++ b/src/version.py @@ -1,3 +1,3 @@ """stick the various versioning attributes in here, so we only have to change them once.""" -version = '0.83.4.1+limnoria (2011-07-09T13:43:24+0200)' +version = '0.83.4.1+limnoria (2011-07-09T13:44:16+0200)'