From 4f38958b702743ef4afe2d04151b3d84d5a5ca42 Mon Sep 17 00:00:00 2001 From: GLolol Date: Fri, 26 Dec 2014 19:10:32 -0500 Subject: [PATCH] Topic: allow configuring whether the separator is allowed in topics --- plugins/Topic/config.py | 5 +++++ plugins/Topic/plugin.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/Topic/config.py b/plugins/Topic/config.py index d18ac546d..f4d7a4344 100644 --- a/plugins/Topic/config.py +++ b/plugins/Topic/config.py @@ -79,6 +79,11 @@ conf.registerChannelValue(Topic, 'requireManageCapability', channel-level capabilities. Note that absence of an explicit anticapability means user has capability."""))) +conf.registerChannelValue(Topic, 'allowSeparatorinTopics', + registry.Boolean(True, _("""Determines whether the bot will allow + topics containing the defined separator to be used. You may want + to disable this if you are signing all topics by nick (see the 'format' + option for ways to adjust this)."""))) # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: diff --git a/plugins/Topic/plugin.py b/plugins/Topic/plugin.py index 1419d3cc8..ab3400457 100644 --- a/plugins/Topic/plugin.py +++ b/plugins/Topic/plugin.py @@ -63,7 +63,8 @@ def canChangeTopic(irc, msg, args, state): def getTopic(irc, msg, args, state, format=True): separator = state.cb.registryValue('separator', state.channel) - if separator in args[0]: + if separator in args[0] and not \ + state.cb.registryValue('allowSeparatorinTopics', state.channel): state.errorInvalid('topic', args[0], format(_('The topic must not include %q.'), separator))