mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-28 05:29:25 +01:00
relay: a few bugfixes
- Only send messages for blocked kicks if the sender is a user - getRemoteUser: only set the .remote attribute when spawning a new user (prevents KeyErrors) - Kick handling: Check for +y too when checking whether the kicker has ops
This commit is contained in:
parent
4d76593901
commit
3f98af6f96
@ -150,7 +150,6 @@ def getRemoteUser(irc, remoteirc, user, spawnIfMissing=True):
|
|||||||
modes=modes, ts=userobj.ts).uid
|
modes=modes, ts=userobj.ts).uid
|
||||||
remoteirc.users[u].remote = irc.name
|
remoteirc.users[u].remote = irc.name
|
||||||
relayusers[(irc.name, user)][remoteirc.name] = u
|
relayusers[(irc.name, user)][remoteirc.name] = u
|
||||||
remoteirc.users[u].remote = irc.name
|
|
||||||
return u
|
return u
|
||||||
|
|
||||||
def getLocalUser(irc, user, targetirc=None):
|
def getLocalUser(irc, user, targetirc=None):
|
||||||
@ -399,7 +398,7 @@ def handle_kick(irc, source, command, args):
|
|||||||
real_target = getLocalUser(irc, target, targetirc=remoteirc)
|
real_target = getLocalUser(irc, target, targetirc=remoteirc)
|
||||||
log.debug('(%s) Relay kick: kicker_modes are %r', irc.name, kicker_modes)
|
log.debug('(%s) Relay kick: kicker_modes are %r', irc.name, kicker_modes)
|
||||||
if irc.name not in db[relay]['claim'] and not \
|
if irc.name not in db[relay]['claim'] and not \
|
||||||
any([mode in kicker_modes for mode in ('q', 'a', 'o', 'h')]):
|
any([mode in kicker_modes for mode in ('y', 'q', 'a', 'o', 'h')]):
|
||||||
log.debug('(%s) Relay kick: kicker %s is not opped... We should rejoin the target user %s', irc.name, kicker, real_target)
|
log.debug('(%s) Relay kick: kicker %s is not opped... We should rejoin the target user %s', irc.name, kicker, real_target)
|
||||||
# Home network is not in the channel's claim AND the kicker is not
|
# Home network is not in the channel's claim AND the kicker is not
|
||||||
# opped. We won't propograte the kick then.
|
# opped. We won't propograte the kick then.
|
||||||
@ -408,6 +407,7 @@ def handle_kick(irc, source, command, args):
|
|||||||
modes = getPrefixModes(remoteirc, irc, remotechan, real_target)
|
modes = getPrefixModes(remoteirc, irc, remotechan, real_target)
|
||||||
# Join the kicked client back with its respective modes.
|
# Join the kicked client back with its respective modes.
|
||||||
irc.proto.sjoinServer(irc, irc.sid, remotechan, [(modes, target)])
|
irc.proto.sjoinServer(irc, irc.sid, remotechan, [(modes, target)])
|
||||||
|
if kicker in irc.users:
|
||||||
utils.msg(irc, kicker, "This channel is claimed; your kick has "
|
utils.msg(irc, kicker, "This channel is claimed; your kick has "
|
||||||
"to %s been blocked because you are not "
|
"to %s been blocked because you are not "
|
||||||
"(half)opped." % channel, notice=True)
|
"(half)opped." % channel, notice=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user