From 6a69ed04599666522665792de8bd1b9113ce15fa Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 21 Jun 2015 17:07:31 -0700 Subject: [PATCH] proto/inspircd: handle RSQUIT for removing PyLink leaves --- protocols/inspircd.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 5cb015b..385f380 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -304,6 +304,24 @@ def handle_squit(irc, numeric, command, args): removeClient(irc, user) del irc.servers[split_server] +def handle_rsquit(irc, numeric, command, args): + # <- :1MLAAAAIG RSQUIT :ayy.lmao + # <- :1MLAAAAIG RSQUIT ayy.lmao :some reason + # If we receive a remote SQUIT from an oper, split the target server + # only if they're identified with us. + target = args[0] + for (sid, server) in irc.servers.items(): + if server.name == target: + target = sid + if isInternalServer(irc, target): + if irc.users[numeric].identified: + uplink = irc.servers[target].uplink + reason = 'Requested by %s' % irc.users[numeric].nick + _sendFromServer(irc, uplink, 'SQUIT %s :%s' % (target, reason)) + handle_squit(irc, numeric, 'SQUIT', [target, reason]) + else: + utils.msg(irc, numeric, 'Error: you are not authorized to split servers!', notice=True) + def handle_idle(irc, numeric, command, args): """Handle the IDLE command, sent between servers in remote WHOIS queries.""" # <- :70MAAAAAA IDLE 1MLAAAAIG