mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +01:00
proto/inspircd: handle RSQUIT for removing PyLink leaves
This commit is contained in:
parent
ab1a946364
commit
6a69ed0459
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user