Changed conf.minHistory to conf.maxHistory.

This commit is contained in:
Jeremy Fincher 2003-04-05 12:25:39 +00:00
parent 6f49bd2813
commit 277a1a356d
2 changed files with 5 additions and 4 deletions

View File

@ -119,9 +119,9 @@ telnetPort = 31337
asyncorePoll = 1
###
# minHistory: Minimum number of messages kept in an Irc object's state.
# maxHistory: Maximum number of messages kept in an Irc object's state.
###
minHistory = 100
maxHistory = 100
###
# pingInterval: Number of seconds between PINGs to the server.

View File

@ -171,9 +171,9 @@ class IrcState(object):
return ret
def addMsg(self, irc, msg):
if len(self.history) > conf.minHistory + 10:
del self.history[:10]
self.history.append(msg)
if len(self.history) > conf.maxHistory:
del self.history[0]
if ircutils.isUserHostmask(msg.prefix) and not msg.command == 'NICK':
self.nicksToHostmasks[msg.nick] = msg.prefix
if msg.command == '352': # Response to a WHO command.
@ -292,6 +292,7 @@ class Irc(object):
self._nickmods = copy.copy(conf.nickmods)
self.state.reset()
self.queue.reset()
self.outstandingPings = set()
self.fastqueue = queue()
self.queue.enqueue(ircmsgs.user(self.user, self.ident))
self.queue.enqueue(ircmsgs.nick(self.nick))