Made channels to be stored in the registry, as well as slightly refactored do376.

This commit is contained in:
Jeremy Fincher 2004-02-07 22:43:45 +00:00
parent c9655c6785
commit 5d5bffe9d2

View File

@ -116,8 +116,9 @@ conf.registerChannelValue(conf.supybot.plugins.Relay, 'color',
conf.registerChannelValue(conf.supybot.plugins.Relay, 'topicSync', conf.registerChannelValue(conf.supybot.plugins.Relay, 'topicSync',
registry.Boolean(True, """Determines whether the bot will synchronize registry.Boolean(True, """Determines whether the bot will synchronize
topics between networks in the channels it relays.""")) topics between networks in the channels it relays."""))
conf.registerGlobalValue(conf.supybot.plugins.Relay, 'channels',
conf.registerGroup(conf.supybot.plugins.Relay, 'networks') conf.SpaceSeparatedListOfChannels([], """Determines which channels the bot
will relay in."""))
class Relay(callbacks.Privmsg): class Relay(callbacks.Privmsg):
noIgnore = True noIgnore = True
@ -128,7 +129,7 @@ class Relay(callbacks.Privmsg):
self.started = False self.started = False
self.ircstates = ircstates self.ircstates = ircstates
self.lastmsg = lastmsg self.lastmsg = lastmsg
self.channels = channels self.channels = self.registryValue('channels')
self._whois = {} self._whois = {}
self.abbreviations = abbreviations self.abbreviations = abbreviations
@ -142,11 +143,12 @@ class Relay(callbacks.Privmsg):
callbacks.Privmsg.__call__(self, irc, msg) callbacks.Privmsg.__call__(self, irc, msg)
def do376(self, irc, msg): def do376(self, irc, msg):
# channels = [] L = []
# networks = conf.supybot.plugins.Relay.networks for channel in self.channels:
# networked = [irc.network for irc in world.ircs] if channel not in irc.state.channels:
if self.channels: L.append(channel)
irc.queueMsg(ircmsgs.joins(self.channels)) if L:
irc.queueMsg(ircmsgs.joins(L))
do377 = do422 = do376 do377 = do422 = do376
def _getRealIrc(self, irc): def _getRealIrc(self, irc):