LinkRelay: Use Limnoria's config callback in order to reload the config if it has been edited manually.

master
Valentin Lorentz 2011-07-01 11:14:56 +02:00
parent 7bf5755b68
commit f4a62b8def
1 changed files with 10 additions and 0 deletions

View File

@ -76,6 +76,16 @@ class LinkRelay(callbacks.Plugin):
self.ircstates = {}
for IRC in world.ircs:
self.addIRC(IRC)
try:
conf.supybot.plugins.LinkRelay.substitutes.addCallback(
self._loadFromConfig)
conf.supybot.plugins.LinkRelay.relays.addCallback(
self._loadFromConfig)
except AttributeError:
irc.error("Your version of Supybot is not compatible with "
"configuration hooks. So, LinkRelay won't be able "
"to reload the configuration if you use the Config "
"plugin.")
def _loadFromConfig(self):
self.relays = []