diff --git a/src/callbacks.py b/src/callbacks.py index 565cc8209..316a01573 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -640,7 +640,7 @@ class Privmsg(irclib.IrcCallback): fakeIrc = ConfigIrcProxy(irc) for args in conf.commandsOnStart: args = args[:] - command = args.pop(0) + command = canonicalName(args.pop(0)) if self.isCommand(command): #debug.printf('%s: %r' % (command, args)) method = getattr(self, command) diff --git a/test/test_callbacks.py b/test/test_callbacks.py index 85bd53f4b..6cf16a0c3 100644 --- a/test/test_callbacks.py +++ b/test/test_callbacks.py @@ -260,6 +260,17 @@ class PrivmsgTestCase(ChannelPluginTestCase): self.assertError('first blah') self.assertResponse('third foo bar baz', 'foo bar baz') + def testConfigureHandlesNonCanonicalCommands(self): + try: + original = conf.commandsOnStart + tokens = callbacks.tokenize('Admin setprefixchar $') + conf.commandsOnStart = [tokens] + self.assertNotError('load Admin') + self.assertEqual(conf.prefixChars, '$') + finally: + conf.commandsOnStart = original + + class PrivmsgCommandAndRegexpTestCase(PluginTestCase): plugins = ('Utilities',) # Gotta put something. @@ -269,7 +280,7 @@ class PrivmsgCommandAndRegexpTestCase(PluginTestCase): raise callbacks.ArgumentError def testNoEscapingArgumentError(self): self.irc.addCallback(self.PCAR()) - self.assertResponse('test', 'test ') + self.assertResponse('test', 'PCAR test ') # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: