Protector: unban user before inviting him. Closes GH-69.

This commit is contained in:
Valentin Lorentz 2011-07-09 13:44:16 +02:00
parent a4653af792
commit f943fee5d5
2 changed files with 8 additions and 2 deletions

View File

@ -143,8 +143,14 @@ class Protector(callbacks.Plugin):
if self.isProtected(irc, channel, hostmask): if self.isProtected(irc, channel, hostmask):
self.log.info('%s was kicked from %s and is protected; ' self.log.info('%s was kicked from %s and is protected; '
'inviting back.', hostmask, channel) 'inviting back.', hostmask, channel)
irc.queueMsg(ircmsgs.invite(nick, channel)) hostmask = '%s!%s' % (nick, irc.state.nickToHostmask(nick))
protected.append(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): if not self.isOp(irc, channel, msg.prefix):
self.demote(irc, channel, msg.nick) self.demote(irc, channel, msg.nick)

View File

@ -1,3 +1,3 @@
"""stick the various versioning attributes in here, so we only have to change """stick the various versioning attributes in here, so we only have to change
them once.""" 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)'