Limiter: Always set the limit above the current number of users

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
James Vega 2009-04-03 11:05:48 -04:00
parent bb759259b8
commit dfbec681d1

View File

@ -1,5 +1,6 @@
### ###
# Copyright (c) 2004-2005, Jeremiah Fincher # Copyright (c) 2004-2005, Jeremiah Fincher
# Copyright (c) 2009, James Vega
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -55,7 +56,7 @@ class Limiter(callbacks.Plugin):
if currentLimit - currentUsers < minimum: if currentLimit - currentUsers < minimum:
self._enforce(irc, ircmsgs.limit(channel,currentUsers+maximum)) self._enforce(irc, ircmsgs.limit(channel,currentUsers+maximum))
elif currentLimit - currentUsers > maximum: elif currentLimit - currentUsers > maximum:
self._enforce(irc, ircmsgs.limit(channel,currentUsers-minimum)) self._enforce(irc, ircmsgs.limit(channel,currentUsers+minimum))
def doJoin(self, irc, msg): def doJoin(self, irc, msg):
if not ircutils.strEqual(msg.nick, irc.nick): if not ircutils.strEqual(msg.nick, irc.nick):