Let's not bother getting database if it's not a channel. Good call.

This commit is contained in:
Jeremy Fincher 2004-08-22 18:58:28 +00:00
parent ab6d1673f3
commit ae048d977a
1 changed files with 13 additions and 12 deletions

View File

@ -173,18 +173,19 @@ class URL(callbacks.PrivmsgCommandAndRegexp):
def doPrivmsg(self, irc, msg):
channel = msg.args[0]
db = self.getDb(channel)
if ircmsgs.isAction(msg):
text = ircmsgs.unAction(msg)
else:
text = msg.args[1]
for url in webutils.urlRe.findall(text):
r = self.registryValue('nonSnarfingRegexp', channel)
if r and r.search(url):
self.log.debug('Skipping adding %r to db.', url)
continue
self.log.debug('Adding %r to db.', url)
db.addUrl(url, msg.nick)
if ircutils.isChannel(channel):
db = self.getDb(channel)
if ircmsgs.isAction(msg):
text = ircmsgs.unAction(msg)
else:
text = msg.args[1]
for url in webutils.urlRe.findall(text):
r = self.registryValue('nonSnarfingRegexp', channel)
if r and r.search(url):
self.log.debug('Skipping adding %r to db.', url)
continue
self.log.debug('Adding %r to db.', url)
db.addUrl(url, msg.nick)
callbacks.PrivmsgCommandAndRegexp.doPrivmsg(self, irc, msg)
def tinyurlSnarfer(self, irc, msg, match):