Converted to use irc.isChannel rather than ircutils.isChannel.

This commit is contained in:
Jeremy Fincher 2004-12-16 07:56:57 +00:00
parent 161b9b96fc
commit a29c4b216a
18 changed files with 25 additions and 25 deletions

View File

@ -234,7 +234,7 @@ class ChannelLogger(callbacks.Privmsg):
def doPrivmsg(self, irc, msg):
(recipients, text) = msg.args
for channel in recipients.split(','):
if ircutils.isChannel(channel):
if irc.isChannel(channel):
noLogPrefix = self.registryValue('noLogPrefix', channel)
if noLogPrefix and text.startswith(noLogPrefix):
text = '-= THIS MESSAGE NOT LOGGED =-'
@ -248,7 +248,7 @@ class ChannelLogger(callbacks.Privmsg):
def doNotice(self, irc, msg):
(recipients, text) = msg.args
for channel in recipients.split(','):
if ircutils.isChannel(channel):
if irc.isChannel(channel):
self.doLog(irc, channel, '-%s- %s\n' % (msg.nick, text))
def doNick(self, irc, msg):
@ -285,7 +285,7 @@ class ChannelLogger(callbacks.Privmsg):
def doMode(self, irc, msg):
channel = msg.args[0]
if ircutils.isChannel(channel) and msg.args[1:]:
if irc.isChannel(channel) and msg.args[1:]:
self.doLog(irc, channel,
'*** %s sets mode: %s %s\n' %
(msg.nick or msg.prefix, msg.args[1],

View File

@ -66,7 +66,7 @@ class Currency(callbacks.Privmsg):
def convert(self, irc, msg, args):
# This specifically does not have a docstring.
channel = None
if ircutils.isChannel(msg.args[0]):
if irc.isChannel(msg.args[0]):
channel = msg.args[0]
realCommandName = self.registryValue('command', channel)
realCommand = getattr(self, realCommandName)

View File

@ -73,7 +73,7 @@ class Dunno(plugins.ChannelIdDatabasePlugin):
callAfter = ['MoobotFactoids']
def invalidCommand(self, irc, msg, tokens):
channel = msg.args[0]
if ircutils.isChannel(channel):
if irc.isChannel(channel):
dunno = self.db.random(channel)
if dunno is not None:
dunno = dunno.text

View File

@ -188,7 +188,7 @@ class Factoids(plugins.ChannelDBHandler, callbacks.Privmsg):
irc.error('No factoid matches that key.')
def tokenizedCommand(self, irc, msg, tokens):
if ircutils.isChannel(msg.args[0]):
if irc.isChannel(msg.args[0]):
channel = msg.args[0]
if self.registryValue('replyWhenInvalidCommand', channel):
key = ' '.join(tokens)

View File

@ -287,7 +287,7 @@ class Karma(callbacks.Privmsg):
def tokenizedCommand(self, irc, msg, tokens):
channel = msg.args[0]
if not ircutils.isChannel(channel):
if not irc.isChannel(channel):
return
if tokens[-1][-2:] in ('++', '--'):
thing = ' '.join(tokens)
@ -296,7 +296,7 @@ class Karma(callbacks.Privmsg):
def doPrivmsg(self, irc, msg):
if not msg.repliedTo:
channel = msg.args[0]
if ircutils.isChannel(channel) and \
if irc.isChannel(channel) and \
self.registryValue('allowUnaddressedKarma', channel):
irc = callbacks.SimpleProxy(irc, msg)
thing = msg.args[1].rstrip()

View File

@ -226,7 +226,7 @@ class LogToIrc(callbacks.Privmsg):
def do376(self, irc, msg):
targets = self.registryValue('targets')
for target in targets:
if ircutils.isChannel(target):
if irc.isChannel(target):
networkGroup = conf.supybot.networks.get(irc.network)
irc.queueMsg(networkGroup.channels.join(target))
do377 = do422 = do376

View File

@ -219,7 +219,7 @@ class Note(callbacks.Privmsg):
specified by separating their names by commas.
"""
# Let's get the from user.
public = ircutils.isChannel(msg.args[0])
public = irc.isChannel(msg.args[0])
sent = []
for target in targets:
id = self.db.send(user.id, target.id, public, text)
@ -242,7 +242,7 @@ class Note(callbacks.Privmsg):
'that have been sent to you.', Raise=True)
self.db.setRead(id)
text += ' (in reply to #%s)' % id
public = ircutils.isChannel(msg.args[0])
public = irc.isChannel(msg.args[0])
try:
target = ircdb.users.getUser(note.frm)
except KeyError:

View File

@ -143,7 +143,7 @@ class Observer(callbacks.Privmsg):
# automatically pick the channel if the message is sent in
# the channel itself.
channel = args.pop(0)
if args or not ircutils.isChannel(channel):
if args or not irc.isChannel(channel):
raise callbacks.ArgumentError
observers = self.registryValue('observers.active', channel)
# We don't sort because order matters.

View File

@ -111,7 +111,7 @@ class Protector(callbacks.Privmsg):
def __call__(self, irc, msg):
if not msg.args:
self.log.debug('Ignoring %r, no msg.args.', msg, irc)
elif not ircutils.isChannel(msg.args[0]):
elif not irc.isChannel(msg.args[0]):
self.log.debug('Ignoring %r, not on a channel.', msg)
elif msg.args[0] not in irc.state.channels:
# One has to wonder how this would happen, but just in case...

View File

@ -212,7 +212,7 @@ class QuoteGrabs(callbacks.Privmsg):
def doPrivmsg(self, irc, msg):
irc = callbacks.SimpleProxy(irc, msg)
if ircutils.isChannel(msg.args[0]):
if irc.isChannel(msg.args[0]):
(channel, payload) = msg.args
words = self.registryValue('randomGrabber.minimumWords',
channel)

View File

@ -371,7 +371,7 @@ class RSS(callbacks.Privmsg):
"""
self.log.debug('Fetching %s', url)
feed = self.getFeed(url)
if ircutils.isChannel(msg.args[0]):
if irc.isChannel(msg.args[0]):
channel = msg.args[0]
else:
channel = None

View File

@ -398,7 +398,7 @@ class Relay(callbacks.Privmsg):
def doPrivmsg(self, irc, msg):
(channel, text) = msg.args
if ircutils.isChannel(channel):
if irc.isChannel(channel):
irc = self._getRealIrc(irc)
if channel not in self.registryValue('channels'):
return

View File

@ -104,7 +104,7 @@ class SeenDB(plugins.ChannelUserDB):
def seen(self, channel, nickOrId):
return self[channel, nickOrId]
filename = os.path.join(conf.supybot.directories.data(), 'Seen.db')
filename = conf.supybot.directories.data.dirize('Seen.db')
class Seen(callbacks.Privmsg):
noIgnore = True
@ -123,7 +123,7 @@ class Seen(callbacks.Privmsg):
self.__parent.die()
def doPrivmsg(self, irc, msg):
if ircutils.isChannel(msg.args[0]):
if irc.isChannel(msg.args[0]):
said = ircmsgs.prettyPrint(msg)
channel = msg.args[0]
self.db.update(channel, msg.nick, said)

View File

@ -153,7 +153,7 @@ class ShrinkUrl(callbacks.PrivmsgCommandAndRegexp):
def outFilter(self, irc, msg):
channel = msg.args[0]
if msg.command == 'PRIVMSG' and ircutils.isChannel(channel):
if msg.command == 'PRIVMSG' and irc.isChannel(channel):
if not msg.shrunken:
if self.registryValue('outFilter', channel):
if webutils.httpUrlRe.search(msg.args[1]):
@ -164,7 +164,7 @@ class ShrinkUrl(callbacks.PrivmsgCommandAndRegexp):
def shrinkSnarfer(self, irc, msg, match):
r"https?://[^\])>\s]{13,}"
channel = msg.args[0]
if not ircutils.isChannel(channel):
if not irc.isChannel(channel):
return
if self.registryValue('shrinkSnarfer', channel):
url = match.group(0)

View File

@ -100,7 +100,7 @@ class URL(callbacks.PrivmsgCommandAndRegexp):
def doPrivmsg(self, irc, msg):
channel = msg.args[0]
if ircutils.isChannel(channel):
if irc.isChannel(channel):
if ircmsgs.isAction(msg):
text = ircmsgs.unAction(msg)
else:
@ -118,7 +118,7 @@ class URL(callbacks.PrivmsgCommandAndRegexp):
def titleSnarfer(self, irc, msg, match):
r"https?://[^\])>\s]+"
channel = msg.args[0]
if not ircutils.isChannel(channel):
if not irc.isChannel(channel):
return
if callbacks.addressed(irc.nick, msg):
return

View File

@ -110,7 +110,7 @@ class Weather(callbacks.Privmsg):
def weather(self, irc, msg, args, location):
# This specifically does not have a docstring.
channel = None
if ircutils.isChannel(msg.args[0]):
if irc.isChannel(msg.args[0]):
channel = msg.args[0]
if not location:
location = self.userValue('lastLocation', msg.prefix)

View File

@ -196,7 +196,7 @@ class WordStats(callbacks.Privmsg):
# This depends on the fact that it's called after the command.
try:
channel = msg.args[0]
if ircutils.isChannel(channel):
if irc.isChannel(channel):
if not (self.queried and
self.registryValue('ignoreQueries', channel)):
self.db.addMsg(msg)

View File

@ -183,7 +183,7 @@ class Words(callbacks.Privmsg):
###
def tokenizedCommand(self, irc, msg, tokens):
channel = msg.args[0]
if ircutils.isChannel(channel):
if irc.isChannel(channel):
if channel in self.games:
if len(tokens) == 1:
c = tokens[0]