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