From 57f8b0d6f768e570c891652fcabfc94eced8a251 Mon Sep 17 00:00:00 2001 From: James Lu Date: Tue, 21 Jul 2015 14:38:53 -0700 Subject: [PATCH] ts6: add handler for BMASK (ban propagation on burst) --- protocols/ts6.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/protocols/ts6.py b/protocols/ts6.py index a3b86fc..6ef657b 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -17,7 +17,7 @@ from inspircd import handle_privmsg, handle_kill, handle_kick, handle_error, \ handle_quit, handle_nick, handle_save, handle_squit, handle_mode, handle_topic, \ handle_notice -hook_map = {'SJOIN': 'JOIN', 'TB': 'TOPIC', 'TMODE': 'MODE'} +hook_map = {'SJOIN': 'JOIN', 'TB': 'TOPIC', 'TMODE': 'MODE', 'BMASK': 'MODE'} def _send(irc, sid, msg): irc.send(':%s %s' % (sid, msg)) @@ -566,3 +566,15 @@ def handle_chghost(irc, numeric, command, args): target = args[0] irc.users[target].host = newhost = args[1] return {'target': numeric, 'newhost': newhost} + +def handle_bmask(irc, numeric, command, args): + # <- :42X BMASK 1424222769 #dev b :*!test@*.isp.net *!badident@* + # This is used for propagating bans, not TMODE! + channel = args[1].lower() + mode = args[2] + ts = int(args[0]) + modes = [] + for ban in args[-1].split(): + modes.append(('+%s' % mode, ban)) + utils.applyModes(irc, channel, modes) + return {'target': channel, 'modes': modes, 'ts': ts}