From 73f639b55fe329a84b33a1d0d58ba73cec8aebbf Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 14 Apr 2005 00:56:26 +0000 Subject: [PATCH] Changed supybot.protocols.irc.refuseToQueueDuplicateMessages to supybot.protocols.irc.queuing.duplicates. --- src/conf.py | 3 ++- src/irclib.py | 2 +- test/test_irclib.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/conf.py b/src/conf.py index fbb6d3c9d..331fbbc45 100644 --- a/src/conf.py +++ b/src/conf.py @@ -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 diff --git a/src/irclib.py b/src/irclib.py index 42dd924b0..9f88fbf4f 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -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 diff --git a/test/test_irclib.py b/test/test_irclib.py index 3efe04167..3ca6db872 100644 --- a/test/test_irclib.py +++ b/test/test_irclib.py @@ -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)