From 664c468130990227dd61bd3ec99d095f513eb298 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 16 Dec 2004 14:16:56 +0000 Subject: [PATCH] Updated to respect channel-value-ish-ness of reply.showSimpleSyntax. --- src/callbacks.py | 9 +++++++-- src/conf.py | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index 39be0b780..637f0983d 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -368,11 +368,11 @@ def findCallbackForCommand(irc, name): L.append(callback) return L -def formatArgumentError(method, name=None, channel=None): +def formatArgumentError(method, name=None): if name is None: name = method.__name__ if hasattr(method, '__doc__') and method.__doc__: - if conf.get(conf.supybot.reply.showSimpleSyntax, channel): + if conf.get(conf.supybot.reply.showSimpleSyntax, dynamic.channel): return getSyntax(method, name=name) else: return getHelp(method, name=name) @@ -1080,6 +1080,11 @@ class Privmsg(irclib.IrcCallback): setattr(self.__class__, canonicalname, dispatcher) def __call__(self, irc, msg): + # This is for later dynamic scoping. + if msg.args and irc.isChannel(msg.args[0]): + channel = msg.args[0] + else: + channel = None if msg.command == 'PRIVMSG': if self.noIgnore or not ircdb.checkIgnored(msg.prefix,msg.args[0]): self.__parent.__call__(irc, msg) diff --git a/src/conf.py b/src/conf.py index d2d3ef425..51b72dc7b 100644 --- a/src/conf.py +++ b/src/conf.py @@ -389,7 +389,6 @@ registerGlobalValue(supybot, 'alwaysJoinOnInvite', a channel if the user inviting it has the 'admin' capability (or if it's explicitly told to join the channel using the Admin.join command)""")) -# XXX: ChannelValue-ishness is not respected for this yet. registerChannelValue(supybot.reply, 'showSimpleSyntax', registry.Boolean(False, """Supybot normally replies with the full help whenever a user misuses a command. If this value is set to True, the bot