From 55723c216165613efb4b60f2d6e965b45b93c1ee Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 27 Jan 2018 13:13:44 -0800 Subject: [PATCH] Services: fix rejoin-on-kickban with atheme 7.x - Adjust _chanRe to only match channels, as atheme also puts the target nick in bold - Look for "unbanned " messages in ChanServ notices (after stripping formatting) This likely fixes GH-166. atheme has been using this format since at least 2005[1], so it's possible that Supybot's rejoin-on-ban had never worked with it. [1]: https://github.com/atheme/atheme/commit/4017c0da85129d11533bb433886139a3a0d75275#diff-ba2bdc02ba7b29fd7e4931cafe63baa0R218 --- plugins/Services/plugin.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/Services/plugin.py b/plugins/Services/plugin.py index 52c20f859..b3aa27ab7 100644 --- a/plugins/Services/plugin.py +++ b/plugins/Services/plugin.py @@ -239,7 +239,7 @@ class Services(callbacks.Plugin): elif chanserv and ircutils.strEqual(msg.nick, chanserv): self.doChanservNotice(irc, msg) - _chanRe = re.compile('\x02(.*?)\x02') + _chanRe = re.compile('\x02(#.*?)\x02') def doChanservNotice(self, irc, msg): if self.disabled(irc): return @@ -250,9 +250,13 @@ class Services(callbacks.Plugin): on = 'on %s' % irc.network if m is not None: channel = m.group(1) - if 'all bans' in s or 'unbanned from' in s: - # All bans removed (freenode) - # You have been unbanned from (oftc) + if 'all bans' in s or 'unbanned from' in s or \ + ('unbanned %s' % irc.nick.lower()) in \ + ircutils.stripFormatting(s): + # All bans removed (old freenode?) + # You have been unbanned from (oftc, anope) + # "Unbanned \x02someuser\x02 from \x02#channel\x02 (\x02N\x02 + # ban(s) removed)" (atheme 7.x) irc.sendMsg(networkGroup.channels.join(channel)) elif 'isn\'t registered' in s: self.log.warning('Received "%s isn\'t registered" from ChanServ %s',