diff --git a/NoTrigger/config.py b/NoTrigger/config.py index a421950..2789ab2 100644 --- a/NoTrigger/config.py +++ b/NoTrigger/config.py @@ -64,5 +64,9 @@ conf.registerChannelValue(NoTrigger.colorAware, 'modes', registry.SpaceSeparatedListOfStrings("c S", _("""Determines a list of modes that should be treated as colour-blocking modes. This is usually +c (block) and +S (stripcolour) on UnrealIRCd/InspIRCd, and just +c (stripcolour) on charybdis-based daemons."""))) +conf.registerChannelValue(NoTrigger, 'blockCtcp', + registry.Boolean(False, _("""Determines whether the bot should block all CTCPs (\001 codes) + except CTCP actions. If you are using the Ctcp plugin, you will want to turn this off."""))) + # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: diff --git a/NoTrigger/plugin.py b/NoTrigger/plugin.py index 0a2f2b6..5326107 100644 --- a/NoTrigger/plugin.py +++ b/NoTrigger/plugin.py @@ -55,7 +55,7 @@ class NoTrigger(callbacks.Plugin): def outFilter(self, irc, msg): if msg.command == 'PRIVMSG' and \ - ircutils(isChannel(msg.args[0]) and \ + ircutils.isChannel(msg.args[0]) and \ self.registryValue('enable', msg.args[0]): s = msg.args[1] prefixes = ["+", "$", ";", ".", "%", "!", "`", "\\", "@", "&", @@ -77,7 +77,8 @@ class NoTrigger(callbacks.Plugin): if s.split()[0][-1] in [",", ":"]: s = " " + s # Handle actions properly but destroy any other \001 (CTCP) messages - if s.startswith("\001") and not s.startswith("\001ACTION"): + if self.registryValue('blockCtcp', msg.args[0]) and \ + s.startswith("\001") and not s.startswith("\001ACTION"): s = s[1:-1] for k, v in rpairs.iteritems(): s = s.replace(k, v)