mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Changed supybot.protocols.irc.refuseToQueueDuplicateMessages to supybot.protocols.irc.queuing.duplicates.
This commit is contained in:
parent
8ce5a18120
commit
73f639b55f
@ -934,7 +934,8 @@ registerGlobalValue(supybot.protocols.irc.ping, 'interval',
|
||||
registry.Integer(120, """Determines the number of seconds between sending
|
||||
pings to the server, if pings are being sent to the server."""))
|
||||
|
||||
registerGlobalValue(supybot.protocols.irc, 'refuseToQueueDuplicateMessages',
|
||||
registerGroup(supybot.protocols.irc, 'queuing')
|
||||
registerGlobalValue(supybot.protocols.irc.queuing, 'duplicates',
|
||||
registry.Boolean(False, """Determines whether the bot will refuse duplicate
|
||||
messages to be queued for delivery to the server. This is a safety
|
||||
mechanism put in place to prevent plugins from sending the same message
|
||||
|
@ -168,7 +168,7 @@ class IrcMsgQueue(object):
|
||||
def enqueue(self, msg):
|
||||
"""Enqueues a given message."""
|
||||
if msg in self and \
|
||||
conf.supybot.protocols.irc.refuseToQueueDuplicateMessages():
|
||||
conf.supybot.protocols.irc.queuing.duplicates():
|
||||
s = str(msg).strip()
|
||||
log.info('Not adding message %q to queue, already added.', s)
|
||||
return False
|
||||
|
@ -140,7 +140,7 @@ class IrcMsgQueueTestCase(SupyTestCase):
|
||||
self.assertEqual(self.msgs[1], q.dequeue())
|
||||
|
||||
def testNoIdenticals(self):
|
||||
configVar = conf.supybot.protocols.irc.refuseToQueueDuplicateMessages
|
||||
configVar = conf.supybot.protocols.irc.queuing.duplicates
|
||||
original = configVar()
|
||||
try:
|
||||
configVar.setValue(True)
|
||||
|
Loading…
Reference in New Issue
Block a user