Changed supybot.protocols.irc.refuseToQueueDuplicateMessages to supybot.protocols.irc.queuing.duplicates.

This commit is contained in:
Jeremy Fincher 2005-04-14 00:56:26 +00:00
parent 8ce5a18120
commit 73f639b55f
3 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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)