3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 12:12:53 +01:00

relay: monitor SAVE floods by network, not by target nick

This commit is contained in:
James Lu 2015-09-12 16:03:17 -07:00
parent 3a8d3d146c
commit 1c97927b5d

View File

@ -1020,7 +1020,7 @@ def handle_save(irc, numeric, command, args):
nick = remoteirc.users[remoteuser].nick
# Limit how many times we can attempt to fix our nick, to prevent
# floods and such.
if savecache.setdefault(target, 0) <= 5:
if savecache.setdefault(irc.name, 0) <= 5:
newnick = normalizeNick(irc, remotenet, nick)
log.info('(%s) SAVE received for relay client %r (%s), fixing nick to %s',
irc.name, target, nick, newnick)
@ -1028,8 +1028,8 @@ def handle_save(irc, numeric, command, args):
else:
log.warning('(%s) SAVE received for relay client %r (%s), not '
'fixing nick again due to 5 failed attempts in '
'the last 10 seconds!', irc.name, target, nick)
savecache[target] += 1
'the last 10 seconds!', irc.name, target, nick)
savecache[irc.name] += 1
else:
# Somebody else on the network (not a PyLink client) had a nick collision;
# relay this as a nick change appropriately.