mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-27 12:44:16 +01:00
Merge branch 'devel' into wip/proto-ts6
This commit is contained in:
commit
b593b39421
@ -258,15 +258,16 @@ def handle_nick(irc, numeric, command, args):
|
|||||||
utils.add_hook(handle_nick, 'NICK')
|
utils.add_hook(handle_nick, 'NICK')
|
||||||
|
|
||||||
def handle_part(irc, numeric, command, args):
|
def handle_part(irc, numeric, command, args):
|
||||||
channel = args['channel']
|
channels = args['channels']
|
||||||
text = args['text']
|
text = args['text']
|
||||||
for netname, user in relayusers[(irc.name, numeric)].copy().items():
|
for channel in channels:
|
||||||
remoteirc = utils.networkobjects[netname]
|
for netname, user in relayusers[(irc.name, numeric)].copy().items():
|
||||||
remotechan = findRemoteChan(irc, remoteirc, channel)
|
remoteirc = utils.networkobjects[netname]
|
||||||
remoteirc.proto.partClient(remoteirc, user, remotechan, text)
|
remotechan = findRemoteChan(irc, remoteirc, channel)
|
||||||
if not remoteirc.users[user].channels:
|
remoteirc.proto.partClient(remoteirc, user, remotechan, text)
|
||||||
remoteirc.proto.quitClient(remoteirc, user, 'Left all shared channels.')
|
if not remoteirc.users[user].channels:
|
||||||
del relayusers[(irc.name, numeric)][remoteirc.name]
|
remoteirc.proto.quitClient(remoteirc, user, 'Left all shared channels.')
|
||||||
|
del relayusers[(irc.name, numeric)][remoteirc.name]
|
||||||
utils.add_hook(handle_part, 'PART')
|
utils.add_hook(handle_part, 'PART')
|
||||||
|
|
||||||
def handle_privmsg(irc, numeric, command, args):
|
def handle_privmsg(irc, numeric, command, args):
|
||||||
|
@ -329,18 +329,19 @@ def handle_kick(irc, source, command, args):
|
|||||||
return {'channel': channel, 'target': kicked, 'text': args[2]}
|
return {'channel': channel, 'target': kicked, 'text': args[2]}
|
||||||
|
|
||||||
def handle_part(irc, source, command, args):
|
def handle_part(irc, source, command, args):
|
||||||
channel = args[0].lower()
|
channels = args[0].lower().split(',')
|
||||||
# We should only get PART commands for channels that exist, right??
|
for channel in channels:
|
||||||
irc.channels[channel].removeuser(source)
|
# We should only get PART commands for channels that exist, right??
|
||||||
try:
|
irc.channels[channel].removeuser(source)
|
||||||
irc.users[source].channels.discard(channel)
|
try:
|
||||||
except KeyError:
|
irc.users[source].channels.discard(channel)
|
||||||
log.debug("(%s) handle_part: KeyError trying to remove %r from %r's channel list?", irc.name, channel, source)
|
except KeyError:
|
||||||
try:
|
log.debug("(%s) handle_part: KeyError trying to remove %r from %r's channel list?", irc.name, channel, source)
|
||||||
reason = args[1]
|
try:
|
||||||
except IndexError:
|
reason = args[1]
|
||||||
reason = ''
|
except IndexError:
|
||||||
return {'channel': channel, 'text': reason}
|
reason = ''
|
||||||
|
return {'channels': channels, 'text': reason}
|
||||||
|
|
||||||
def handle_error(irc, numeric, command, args):
|
def handle_error(irc, numeric, command, args):
|
||||||
irc.connected = False
|
irc.connected = False
|
||||||
@ -453,27 +454,6 @@ def handle_squit(irc, numeric, command, args):
|
|||||||
log.debug('(%s) Netsplit affected users: %s', irc.name, affected_users)
|
log.debug('(%s) Netsplit affected users: %s', irc.name, affected_users)
|
||||||
return {'target': split_server, 'users': affected_users}
|
return {'target': split_server, 'users': affected_users}
|
||||||
|
|
||||||
def handle_rsquit(irc, numeric, command, args):
|
|
||||||
# <- :1MLAAAAIG RSQUIT :ayy.lmao
|
|
||||||
# <- :1MLAAAAIG RSQUIT ayy.lmao :some reason
|
|
||||||
# RSQUIT is sent by opers to squit remote servers.
|
|
||||||
# Strangely, it takes a server name instead of a SID, and is
|
|
||||||
# allowed to be ignored entirely.
|
|
||||||
# If we receive a remote SQUIT, split the target server
|
|
||||||
# ONLY if the sender is identified with us.
|
|
||||||
target = args[0]
|
|
||||||
for (sid, server) in irc.servers.items():
|
|
||||||
if server.name == target:
|
|
||||||
target = sid
|
|
||||||
if utils.isInternalServer(irc, target):
|
|
||||||
if irc.users[numeric].identified:
|
|
||||||
uplink = irc.servers[target].uplink
|
|
||||||
reason = 'Requested by %s' % irc.users[numeric].nick
|
|
||||||
_send(irc, uplink, 'SQUIT %s :%s' % (target, reason))
|
|
||||||
return 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):
|
def handle_idle(irc, numeric, command, args):
|
||||||
"""Handle the IDLE command, sent between servers in remote WHOIS queries."""
|
"""Handle the IDLE command, sent between servers in remote WHOIS queries."""
|
||||||
# <- :70MAAAAAA IDLE 1MLAAAAIG
|
# <- :70MAAAAAA IDLE 1MLAAAAIG
|
||||||
|
Loading…
Reference in New Issue
Block a user