mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 20:22:45 +01:00
relay: monitor SAVE floods by network, not by target nick
This commit is contained in:
parent
3a8d3d146c
commit
1c97927b5d
@ -1020,7 +1020,7 @@ def handle_save(irc, numeric, command, args):
|
|||||||
nick = remoteirc.users[remoteuser].nick
|
nick = remoteirc.users[remoteuser].nick
|
||||||
# Limit how many times we can attempt to fix our nick, to prevent
|
# Limit how many times we can attempt to fix our nick, to prevent
|
||||||
# floods and such.
|
# floods and such.
|
||||||
if savecache.setdefault(target, 0) <= 5:
|
if savecache.setdefault(irc.name, 0) <= 5:
|
||||||
newnick = normalizeNick(irc, remotenet, nick)
|
newnick = normalizeNick(irc, remotenet, nick)
|
||||||
log.info('(%s) SAVE received for relay client %r (%s), fixing nick to %s',
|
log.info('(%s) SAVE received for relay client %r (%s), fixing nick to %s',
|
||||||
irc.name, target, nick, newnick)
|
irc.name, target, nick, newnick)
|
||||||
@ -1028,8 +1028,8 @@ def handle_save(irc, numeric, command, args):
|
|||||||
else:
|
else:
|
||||||
log.warning('(%s) SAVE received for relay client %r (%s), not '
|
log.warning('(%s) SAVE received for relay client %r (%s), not '
|
||||||
'fixing nick again due to 5 failed attempts in '
|
'fixing nick again due to 5 failed attempts in '
|
||||||
'the last 10 seconds!', irc.name, target, nick)
|
'the last 10 seconds!', irc.name, target, nick)
|
||||||
savecache[target] += 1
|
savecache[irc.name] += 1
|
||||||
else:
|
else:
|
||||||
# Somebody else on the network (not a PyLink client) had a nick collision;
|
# Somebody else on the network (not a PyLink client) had a nick collision;
|
||||||
# relay this as a nick change appropriately.
|
# relay this as a nick change appropriately.
|
||||||
|
Loading…
Reference in New Issue
Block a user