mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Merge pull request #943 from GLolol/topic-1
Topic: allow toggling automatic topic setting via config
This commit is contained in:
commit
f65d742fee
@ -61,9 +61,13 @@ conf.registerChannelValue(Topic, 'recognizeTopiclen',
|
||||
conf.registerChannelValue(Topic, 'default',
|
||||
registry.String('', _("""Determines what the default topic for the channel
|
||||
is. This is used by the default command to set this topic.""")))
|
||||
conf.registerChannelValue(Topic, 'setOnJoin',
|
||||
registry.Boolean(True, _("""Determines whether the bot will automatically
|
||||
set the topic on join if it is empty.""")))
|
||||
conf.registerChannelValue(Topic, 'alwaysSetOnJoin',
|
||||
registry.Boolean(False, _("""Determines whether the bot will set the topic
|
||||
every time it joins, or only if the topic is empty.""")))
|
||||
every time it joins, or only if the topic is empty. Requires 'config
|
||||
plugins.topic.setOnJoin' to be set to True.""")))
|
||||
conf.registerGroup(Topic, 'undo')
|
||||
conf.registerChannelValue(Topic.undo, 'max',
|
||||
registry.NonNegativeInteger(10, _("""Determines the number of previous
|
||||
|
@ -250,7 +250,7 @@ class Topic(callbacks.Plugin):
|
||||
# Try to restore the topic when not set yet.
|
||||
channel = msg.args[1]
|
||||
c = irc.state.channels.get(channel)
|
||||
if c is None:
|
||||
if c is None or not self.registryValue('setOnJoin', channel):
|
||||
return
|
||||
if irc.nick not in c.ops and 't' in c.modes:
|
||||
self.log.debug('Not trying to restore topic in %s. I\'m not opped '
|
||||
|
Loading…
Reference in New Issue
Block a user