mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +01:00
relay: fix errors in KILL handling when target isn't in any relay channels
This commit is contained in:
parent
3527960d18
commit
7f5bc52152
@ -1081,8 +1081,15 @@ utils.add_hook(handle_topic, 'TOPIC')
|
|||||||
def handle_kill(irc, numeric, command, args):
|
def handle_kill(irc, numeric, command, args):
|
||||||
target = args['target']
|
target = args['target']
|
||||||
userdata = args['userdata']
|
userdata = args['userdata']
|
||||||
realuser = getOrigUser(irc, target) or userdata.__dict__.get('remote')
|
|
||||||
|
# Try to find the original client of the target being killed
|
||||||
|
if userdata and hasattr(userdata, 'remote'):
|
||||||
|
realuser = userdata.remote
|
||||||
|
else:
|
||||||
|
realuser = getOrigUser(irc, target)
|
||||||
|
|
||||||
log.debug('(%s) relay.handle_kill: realuser is %r', irc.name, realuser)
|
log.debug('(%s) relay.handle_kill: realuser is %r', irc.name, realuser)
|
||||||
|
|
||||||
# Target user was remote:
|
# Target user was remote:
|
||||||
if realuser and realuser[0] != irc.name:
|
if realuser and realuser[0] != irc.name:
|
||||||
# We don't allow killing over the relay, so we must respawn the affected
|
# We don't allow killing over the relay, so we must respawn the affected
|
||||||
@ -1097,6 +1104,7 @@ def handle_kill(irc, numeric, command, args):
|
|||||||
log.debug('(%s) relay.handle_kill: userpair: %s, %s', irc.name, modes, realuser)
|
log.debug('(%s) relay.handle_kill: userpair: %s, %s', irc.name, modes, realuser)
|
||||||
client = getRemoteUser(remoteirc, irc, realuser[1])
|
client = getRemoteUser(remoteirc, irc, realuser[1])
|
||||||
irc.proto.sjoin(getRemoteSid(irc, remoteirc), localchan, [(modes, client)])
|
irc.proto.sjoin(getRemoteSid(irc, remoteirc), localchan, [(modes, client)])
|
||||||
|
|
||||||
if userdata and numeric in irc.users:
|
if userdata and numeric in irc.users:
|
||||||
log.info('(%s) relay.handle_kill: Blocked KILL (reason %r) from %s to relay client %s/%s.',
|
log.info('(%s) relay.handle_kill: Blocked KILL (reason %r) from %s to relay client %s/%s.',
|
||||||
irc.name, args['text'], irc.users[numeric].nick,
|
irc.name, args['text'], irc.users[numeric].nick,
|
||||||
|
Loading…
Reference in New Issue
Block a user