From d18b2e49ff66fbb3abd72cef405c213bf15188ce Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Thu, 16 Dec 2010 21:06:20 -0600 Subject: [PATCH] add 'meta.internal_only' option, defaulting to true this allows for better control on recursion/alias type things, which is an awful lot of what the bot does these days --- Module.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Module.py b/Module.py index 47da27a..ed4bc51 100644 --- a/Module.py +++ b/Module.py @@ -117,6 +117,15 @@ class Module(object): addressed_pattern = '^' + connection.get_nickname() + '[:,]?\s+' addressed_re = re.compile(addressed_pattern) + # see if we should just skip msg stuff entirely (common for stuff run via alias) + internal_only = True + try: + internal_only = self.config.getboolean(self.__class__.__name__, 'meta.internal_only') + except NoOptionError: pass + except NoSectionError: pass + if internal_only and replypath is not None: + return + need_prefix = True try: need_prefix = self.config.getboolean(self.__class__.__name__, 'meta.pubmsg_needs_bot_prefix') @@ -174,6 +183,15 @@ class Module(object): admin_unlocked = True except NoOptionError: pass + # see if we should just skip msg stuff entirely (common for stuff run via alias) + internal_only = True + try: + internal_only = self.config.getboolean(self.__class__.__name__, 'meta.internal_only') + except NoOptionError: pass + except NoSectionError: pass + if internal_only and replypath is not None: + return + if replypath is not None: what = self.try_recursion(connection, event, nick, userhost, replypath, what, admin_unlocked)