Topic: allow configuring whether the separator is allowed in topics

This commit is contained in:
GLolol 2014-12-26 19:10:32 -05:00
parent f4425de7c5
commit 4f38958b70
2 changed files with 7 additions and 1 deletions

View File

@ -79,6 +79,11 @@ conf.registerChannelValue(Topic, 'requireManageCapability',
channel-level capabilities. channel-level capabilities.
Note that absence of an explicit anticapability means user has Note that absence of an explicit anticapability means user has
capability."""))) 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: # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -63,7 +63,8 @@ def canChangeTopic(irc, msg, args, state):
def getTopic(irc, msg, args, state, format=True): def getTopic(irc, msg, args, state, format=True):
separator = state.cb.registryValue('separator', state.channel) 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], state.errorInvalid('topic', args[0],
format(_('The topic must not include %q.'), format(_('The topic must not include %q.'),
separator)) separator))