mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-02 16:09:24 +01:00
Changed IrcState.history to a RingBuffer instead of a MaxLengthQueue.
This commit is contained in:
parent
ff54eecefc
commit
6eacfb6c26
@ -30,7 +30,7 @@
|
|||||||
###
|
###
|
||||||
|
|
||||||
from fix import *
|
from fix import *
|
||||||
from structures import queue, MaxLengthQueue
|
from structures import queue, RingBuffer
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import time
|
import time
|
||||||
@ -171,7 +171,7 @@ class IrcState(object):
|
|||||||
self.reset()
|
self.reset()
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
self.history = MaxLengthQueue(conf.maxHistory)
|
self.history = RingBuffer(conf.maxHistory)
|
||||||
self.nicksToHostmasks = ircutils.IrcDict()
|
self.nicksToHostmasks = ircutils.IrcDict()
|
||||||
self.channels = ircutils.IrcDict()
|
self.channels = ircutils.IrcDict()
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ class IrcState(object):
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
def addMsg(self, irc, msg):
|
def addMsg(self, irc, msg):
|
||||||
self.history.enqueue(msg)
|
self.history.append(msg)
|
||||||
if ircutils.isUserHostmask(msg.prefix) and not msg.command == 'NICK':
|
if ircutils.isUserHostmask(msg.prefix) and not msg.command == 'NICK':
|
||||||
self.nicksToHostmasks[msg.nick] = msg.prefix
|
self.nicksToHostmasks[msg.nick] = msg.prefix
|
||||||
if msg.command == '352': # Response to a WHO command.
|
if msg.command == '352': # Response to a WHO command.
|
||||||
|
Loading…
Reference in New Issue
Block a user