mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +01:00
Converted to use irc.isChannel rather than ircutils.isChannel.
This commit is contained in:
parent
161b9b96fc
commit
a29c4b216a
@ -234,7 +234,7 @@ class ChannelLogger(callbacks.Privmsg):
|
|||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
(recipients, text) = msg.args
|
(recipients, text) = msg.args
|
||||||
for channel in recipients.split(','):
|
for channel in recipients.split(','):
|
||||||
if ircutils.isChannel(channel):
|
if irc.isChannel(channel):
|
||||||
noLogPrefix = self.registryValue('noLogPrefix', channel)
|
noLogPrefix = self.registryValue('noLogPrefix', channel)
|
||||||
if noLogPrefix and text.startswith(noLogPrefix):
|
if noLogPrefix and text.startswith(noLogPrefix):
|
||||||
text = '-= THIS MESSAGE NOT LOGGED =-'
|
text = '-= THIS MESSAGE NOT LOGGED =-'
|
||||||
@ -248,7 +248,7 @@ class ChannelLogger(callbacks.Privmsg):
|
|||||||
def doNotice(self, irc, msg):
|
def doNotice(self, irc, msg):
|
||||||
(recipients, text) = msg.args
|
(recipients, text) = msg.args
|
||||||
for channel in recipients.split(','):
|
for channel in recipients.split(','):
|
||||||
if ircutils.isChannel(channel):
|
if irc.isChannel(channel):
|
||||||
self.doLog(irc, channel, '-%s- %s\n' % (msg.nick, text))
|
self.doLog(irc, channel, '-%s- %s\n' % (msg.nick, text))
|
||||||
|
|
||||||
def doNick(self, irc, msg):
|
def doNick(self, irc, msg):
|
||||||
@ -285,7 +285,7 @@ class ChannelLogger(callbacks.Privmsg):
|
|||||||
|
|
||||||
def doMode(self, irc, msg):
|
def doMode(self, irc, msg):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if ircutils.isChannel(channel) and msg.args[1:]:
|
if irc.isChannel(channel) and msg.args[1:]:
|
||||||
self.doLog(irc, channel,
|
self.doLog(irc, channel,
|
||||||
'*** %s sets mode: %s %s\n' %
|
'*** %s sets mode: %s %s\n' %
|
||||||
(msg.nick or msg.prefix, msg.args[1],
|
(msg.nick or msg.prefix, msg.args[1],
|
||||||
|
@ -66,7 +66,7 @@ class Currency(callbacks.Privmsg):
|
|||||||
def convert(self, irc, msg, args):
|
def convert(self, irc, msg, args):
|
||||||
# This specifically does not have a docstring.
|
# This specifically does not have a docstring.
|
||||||
channel = None
|
channel = None
|
||||||
if ircutils.isChannel(msg.args[0]):
|
if irc.isChannel(msg.args[0]):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
realCommandName = self.registryValue('command', channel)
|
realCommandName = self.registryValue('command', channel)
|
||||||
realCommand = getattr(self, realCommandName)
|
realCommand = getattr(self, realCommandName)
|
||||||
|
@ -73,7 +73,7 @@ class Dunno(plugins.ChannelIdDatabasePlugin):
|
|||||||
callAfter = ['MoobotFactoids']
|
callAfter = ['MoobotFactoids']
|
||||||
def invalidCommand(self, irc, msg, tokens):
|
def invalidCommand(self, irc, msg, tokens):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if ircutils.isChannel(channel):
|
if irc.isChannel(channel):
|
||||||
dunno = self.db.random(channel)
|
dunno = self.db.random(channel)
|
||||||
if dunno is not None:
|
if dunno is not None:
|
||||||
dunno = dunno.text
|
dunno = dunno.text
|
||||||
|
@ -188,7 +188,7 @@ class Factoids(plugins.ChannelDBHandler, callbacks.Privmsg):
|
|||||||
irc.error('No factoid matches that key.')
|
irc.error('No factoid matches that key.')
|
||||||
|
|
||||||
def tokenizedCommand(self, irc, msg, tokens):
|
def tokenizedCommand(self, irc, msg, tokens):
|
||||||
if ircutils.isChannel(msg.args[0]):
|
if irc.isChannel(msg.args[0]):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if self.registryValue('replyWhenInvalidCommand', channel):
|
if self.registryValue('replyWhenInvalidCommand', channel):
|
||||||
key = ' '.join(tokens)
|
key = ' '.join(tokens)
|
||||||
|
@ -287,7 +287,7 @@ class Karma(callbacks.Privmsg):
|
|||||||
|
|
||||||
def tokenizedCommand(self, irc, msg, tokens):
|
def tokenizedCommand(self, irc, msg, tokens):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if not ircutils.isChannel(channel):
|
if not irc.isChannel(channel):
|
||||||
return
|
return
|
||||||
if tokens[-1][-2:] in ('++', '--'):
|
if tokens[-1][-2:] in ('++', '--'):
|
||||||
thing = ' '.join(tokens)
|
thing = ' '.join(tokens)
|
||||||
@ -296,7 +296,7 @@ class Karma(callbacks.Privmsg):
|
|||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
if not msg.repliedTo:
|
if not msg.repliedTo:
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if ircutils.isChannel(channel) and \
|
if irc.isChannel(channel) and \
|
||||||
self.registryValue('allowUnaddressedKarma', channel):
|
self.registryValue('allowUnaddressedKarma', channel):
|
||||||
irc = callbacks.SimpleProxy(irc, msg)
|
irc = callbacks.SimpleProxy(irc, msg)
|
||||||
thing = msg.args[1].rstrip()
|
thing = msg.args[1].rstrip()
|
||||||
|
@ -226,7 +226,7 @@ class LogToIrc(callbacks.Privmsg):
|
|||||||
def do376(self, irc, msg):
|
def do376(self, irc, msg):
|
||||||
targets = self.registryValue('targets')
|
targets = self.registryValue('targets')
|
||||||
for target in targets:
|
for target in targets:
|
||||||
if ircutils.isChannel(target):
|
if irc.isChannel(target):
|
||||||
networkGroup = conf.supybot.networks.get(irc.network)
|
networkGroup = conf.supybot.networks.get(irc.network)
|
||||||
irc.queueMsg(networkGroup.channels.join(target))
|
irc.queueMsg(networkGroup.channels.join(target))
|
||||||
do377 = do422 = do376
|
do377 = do422 = do376
|
||||||
|
@ -219,7 +219,7 @@ class Note(callbacks.Privmsg):
|
|||||||
specified by separating their names by commas.
|
specified by separating their names by commas.
|
||||||
"""
|
"""
|
||||||
# Let's get the from user.
|
# Let's get the from user.
|
||||||
public = ircutils.isChannel(msg.args[0])
|
public = irc.isChannel(msg.args[0])
|
||||||
sent = []
|
sent = []
|
||||||
for target in targets:
|
for target in targets:
|
||||||
id = self.db.send(user.id, target.id, public, text)
|
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)
|
'that have been sent to you.', Raise=True)
|
||||||
self.db.setRead(id)
|
self.db.setRead(id)
|
||||||
text += ' (in reply to #%s)' % id
|
text += ' (in reply to #%s)' % id
|
||||||
public = ircutils.isChannel(msg.args[0])
|
public = irc.isChannel(msg.args[0])
|
||||||
try:
|
try:
|
||||||
target = ircdb.users.getUser(note.frm)
|
target = ircdb.users.getUser(note.frm)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
@ -143,7 +143,7 @@ class Observer(callbacks.Privmsg):
|
|||||||
# automatically pick the channel if the message is sent in
|
# automatically pick the channel if the message is sent in
|
||||||
# the channel itself.
|
# the channel itself.
|
||||||
channel = args.pop(0)
|
channel = args.pop(0)
|
||||||
if args or not ircutils.isChannel(channel):
|
if args or not irc.isChannel(channel):
|
||||||
raise callbacks.ArgumentError
|
raise callbacks.ArgumentError
|
||||||
observers = self.registryValue('observers.active', channel)
|
observers = self.registryValue('observers.active', channel)
|
||||||
# We don't sort because order matters.
|
# We don't sort because order matters.
|
||||||
|
@ -111,7 +111,7 @@ class Protector(callbacks.Privmsg):
|
|||||||
def __call__(self, irc, msg):
|
def __call__(self, irc, msg):
|
||||||
if not msg.args:
|
if not msg.args:
|
||||||
self.log.debug('Ignoring %r, no msg.args.', msg, irc)
|
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)
|
self.log.debug('Ignoring %r, not on a channel.', msg)
|
||||||
elif msg.args[0] not in irc.state.channels:
|
elif msg.args[0] not in irc.state.channels:
|
||||||
# One has to wonder how this would happen, but just in case...
|
# One has to wonder how this would happen, but just in case...
|
||||||
|
@ -212,7 +212,7 @@ class QuoteGrabs(callbacks.Privmsg):
|
|||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
irc = callbacks.SimpleProxy(irc, msg)
|
irc = callbacks.SimpleProxy(irc, msg)
|
||||||
if ircutils.isChannel(msg.args[0]):
|
if irc.isChannel(msg.args[0]):
|
||||||
(channel, payload) = msg.args
|
(channel, payload) = msg.args
|
||||||
words = self.registryValue('randomGrabber.minimumWords',
|
words = self.registryValue('randomGrabber.minimumWords',
|
||||||
channel)
|
channel)
|
||||||
|
@ -371,7 +371,7 @@ class RSS(callbacks.Privmsg):
|
|||||||
"""
|
"""
|
||||||
self.log.debug('Fetching %s', url)
|
self.log.debug('Fetching %s', url)
|
||||||
feed = self.getFeed(url)
|
feed = self.getFeed(url)
|
||||||
if ircutils.isChannel(msg.args[0]):
|
if irc.isChannel(msg.args[0]):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
else:
|
else:
|
||||||
channel = None
|
channel = None
|
||||||
|
@ -398,7 +398,7 @@ class Relay(callbacks.Privmsg):
|
|||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
(channel, text) = msg.args
|
(channel, text) = msg.args
|
||||||
if ircutils.isChannel(channel):
|
if irc.isChannel(channel):
|
||||||
irc = self._getRealIrc(irc)
|
irc = self._getRealIrc(irc)
|
||||||
if channel not in self.registryValue('channels'):
|
if channel not in self.registryValue('channels'):
|
||||||
return
|
return
|
||||||
|
@ -104,7 +104,7 @@ class SeenDB(plugins.ChannelUserDB):
|
|||||||
def seen(self, channel, nickOrId):
|
def seen(self, channel, nickOrId):
|
||||||
return 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):
|
class Seen(callbacks.Privmsg):
|
||||||
noIgnore = True
|
noIgnore = True
|
||||||
@ -123,7 +123,7 @@ class Seen(callbacks.Privmsg):
|
|||||||
self.__parent.die()
|
self.__parent.die()
|
||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
if ircutils.isChannel(msg.args[0]):
|
if irc.isChannel(msg.args[0]):
|
||||||
said = ircmsgs.prettyPrint(msg)
|
said = ircmsgs.prettyPrint(msg)
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
self.db.update(channel, msg.nick, said)
|
self.db.update(channel, msg.nick, said)
|
||||||
|
@ -153,7 +153,7 @@ class ShrinkUrl(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
|
|
||||||
def outFilter(self, irc, msg):
|
def outFilter(self, irc, msg):
|
||||||
channel = msg.args[0]
|
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 not msg.shrunken:
|
||||||
if self.registryValue('outFilter', channel):
|
if self.registryValue('outFilter', channel):
|
||||||
if webutils.httpUrlRe.search(msg.args[1]):
|
if webutils.httpUrlRe.search(msg.args[1]):
|
||||||
@ -164,7 +164,7 @@ class ShrinkUrl(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
def shrinkSnarfer(self, irc, msg, match):
|
def shrinkSnarfer(self, irc, msg, match):
|
||||||
r"https?://[^\])>\s]{13,}"
|
r"https?://[^\])>\s]{13,}"
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if not ircutils.isChannel(channel):
|
if not irc.isChannel(channel):
|
||||||
return
|
return
|
||||||
if self.registryValue('shrinkSnarfer', channel):
|
if self.registryValue('shrinkSnarfer', channel):
|
||||||
url = match.group(0)
|
url = match.group(0)
|
||||||
|
@ -100,7 +100,7 @@ class URL(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if ircutils.isChannel(channel):
|
if irc.isChannel(channel):
|
||||||
if ircmsgs.isAction(msg):
|
if ircmsgs.isAction(msg):
|
||||||
text = ircmsgs.unAction(msg)
|
text = ircmsgs.unAction(msg)
|
||||||
else:
|
else:
|
||||||
@ -118,7 +118,7 @@ class URL(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
def titleSnarfer(self, irc, msg, match):
|
def titleSnarfer(self, irc, msg, match):
|
||||||
r"https?://[^\])>\s]+"
|
r"https?://[^\])>\s]+"
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if not ircutils.isChannel(channel):
|
if not irc.isChannel(channel):
|
||||||
return
|
return
|
||||||
if callbacks.addressed(irc.nick, msg):
|
if callbacks.addressed(irc.nick, msg):
|
||||||
return
|
return
|
||||||
|
@ -110,7 +110,7 @@ class Weather(callbacks.Privmsg):
|
|||||||
def weather(self, irc, msg, args, location):
|
def weather(self, irc, msg, args, location):
|
||||||
# This specifically does not have a docstring.
|
# This specifically does not have a docstring.
|
||||||
channel = None
|
channel = None
|
||||||
if ircutils.isChannel(msg.args[0]):
|
if irc.isChannel(msg.args[0]):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if not location:
|
if not location:
|
||||||
location = self.userValue('lastLocation', msg.prefix)
|
location = self.userValue('lastLocation', msg.prefix)
|
||||||
|
@ -196,7 +196,7 @@ class WordStats(callbacks.Privmsg):
|
|||||||
# This depends on the fact that it's called after the command.
|
# This depends on the fact that it's called after the command.
|
||||||
try:
|
try:
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if ircutils.isChannel(channel):
|
if irc.isChannel(channel):
|
||||||
if not (self.queried and
|
if not (self.queried and
|
||||||
self.registryValue('ignoreQueries', channel)):
|
self.registryValue('ignoreQueries', channel)):
|
||||||
self.db.addMsg(msg)
|
self.db.addMsg(msg)
|
||||||
|
@ -183,7 +183,7 @@ class Words(callbacks.Privmsg):
|
|||||||
###
|
###
|
||||||
def tokenizedCommand(self, irc, msg, tokens):
|
def tokenizedCommand(self, irc, msg, tokens):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if ircutils.isChannel(channel):
|
if irc.isChannel(channel):
|
||||||
if channel in self.games:
|
if channel in self.games:
|
||||||
if len(tokens) == 1:
|
if len(tokens) == 1:
|
||||||
c = tokens[0]
|
c = tokens[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user