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