From daf81b1b9043e50d52c200438032e6d99c3497f0 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 6 Aug 2004 06:57:54 +0000 Subject: [PATCH] Added a registry variable for disallowed list --private. --- src/Misc.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Misc.py b/src/Misc.py index 6388d8513..c413d169b 100755 --- a/src/Misc.py +++ b/src/Misc.py @@ -51,8 +51,16 @@ import supybot.ircmsgs as ircmsgs import supybot.ircutils as ircutils import supybot.privmsgs as privmsgs import supybot.webutils as webutils +import supybot.registry as registry import supybot.callbacks as callbacks +conf.registerPlugin('Misc') +conf.registerGlobalValue(conf.supybot.plugins.Misc, 'listPrivatePlugins', + registry.Boolean(True, """Determines whether the bot will list private + plugins with the list command if given the --private switch. If this is + disabled, non-owner users should be unable to see what private plugins + are loaded.""")) + class Misc(callbacks.Privmsg): priority = sys.maxint def invalidCommand(self, irc, msg, tokens): @@ -81,6 +89,10 @@ class Misc(callbacks.Privmsg): for (option, argument) in optlist: if option == '--private': private = True + if not self.registryValue('listPrivatePlugins') and \ + not ircdb.checkCapability(msg.prefix, 'owner'): + irc.errorNoCapability('owner') + return name = privmsgs.getArgs(rest, required=0, optional=1) name = callbacks.canonicalName(name) if not name: