Update Encyclopedia
Make sure Lart, Mess, Webcal and IRCLogin all work when defaultIgnore is True
This commit is contained in:
parent
95544ba73f
commit
4105f4f2db
|
@ -40,7 +40,7 @@ total = 0
|
||||||
# Read POST
|
# Read POST
|
||||||
if 'db' in form:
|
if 'db' in form:
|
||||||
database = form['db'].value
|
database = form['db'].value
|
||||||
if database not in database:
|
if database not in databases:
|
||||||
database = default_database
|
database = default_database
|
||||||
con = sqlite.connect(os.path.join(datadir, database + '.db'))
|
con = sqlite.connect(os.path.join(datadir, database + '.db'))
|
||||||
cur = con.cursor()
|
cur = con.cursor()
|
||||||
|
|
|
@ -198,6 +198,7 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
self.databases[channel] = sqlite.connect(os.path.join(self.registryValue('datadir'), '%s.db' % db))
|
self.databases[channel] = sqlite.connect(os.path.join(self.registryValue('datadir'), '%s.db' % db))
|
||||||
self.databases[channel].name = db
|
self.databases[channel].name = db
|
||||||
self.databases[channel].time = time.time()
|
self.databases[channel].time = time.time()
|
||||||
|
self.log.info(os.path.join(self.registryValue('datadir'), '%s.db' % db))
|
||||||
return self.databases[channel]
|
return self.databases[channel]
|
||||||
|
|
||||||
def addressed(self, recipients, text, irc):
|
def addressed(self, recipients, text, irc):
|
||||||
|
|
|
@ -163,6 +163,12 @@ launchpad"""
|
||||||
return
|
return
|
||||||
to = msg.args[0]
|
to = msg.args[0]
|
||||||
cmd = msg.args[1]
|
cmd = msg.args[1]
|
||||||
|
try:
|
||||||
|
user = ircdb.users.getUser(msg.prefix)
|
||||||
|
if user.checkHostmask(msg.prefix):
|
||||||
|
return
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if to.lower() == irc.nick.lower():
|
if to.lower() == irc.nick.lower():
|
||||||
if cmd != "login":
|
if cmd != "login":
|
||||||
return
|
return
|
||||||
|
|
|
@ -95,6 +95,38 @@ class Lart(plugins.ChannelIdDatabasePlugin):
|
||||||
pity = lart
|
pity = lart
|
||||||
slander = lart
|
slander = lart
|
||||||
|
|
||||||
|
def callPrecedence(self, irc):
|
||||||
|
before = []
|
||||||
|
for cb in irc.callbacks:
|
||||||
|
if cb.name() == 'IRCLogin':
|
||||||
|
before.append(cb)
|
||||||
|
return (before, [])
|
||||||
|
|
||||||
|
def inFilter(self, irc, msg):
|
||||||
|
if not msg.command == 'PRIVMSG':
|
||||||
|
return msg
|
||||||
|
if not conf.supybot.defaultIgnore():
|
||||||
|
return msg
|
||||||
|
s = callbacks.addressed(irc.nick, msg)
|
||||||
|
if not s:
|
||||||
|
return msg
|
||||||
|
if checkIgnored(msg.prefix):
|
||||||
|
return msg
|
||||||
|
try:
|
||||||
|
id = ircdb.users.getUserId(msg.prefix)
|
||||||
|
user = users.getUser(id)
|
||||||
|
return msg
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
cmd, args = (s.split(None, 1) + [None])[:2]
|
||||||
|
if cmd and cmd[0] in str(conf.supybot.reply.whenAddressedBy.chars.get(msg.args[0])):
|
||||||
|
cmd = cmd[1:]
|
||||||
|
if cmd in self.listCommands():
|
||||||
|
tokens = callbacks.tokenize(s, channel=msg.args[0])
|
||||||
|
self.Proxy(irc, msg, tokens)
|
||||||
|
return msg
|
||||||
|
# self._callCommand([cmd], irc, msg, [])
|
||||||
|
|
||||||
Class = Lart
|
Class = Lart
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||||
|
|
|
@ -239,4 +239,35 @@ class Mess(callbacks.PluginRegexp):
|
||||||
irc.reply("No %s can't have a pony, %s!" % (text, msg.nick))
|
irc.reply("No %s can't have a pony, %s!" % (text, msg.nick))
|
||||||
pony = wrap(pony, [additional('text')])
|
pony = wrap(pony, [additional('text')])
|
||||||
|
|
||||||
|
def callPrecedence(self, irc):
|
||||||
|
before = []
|
||||||
|
for cb in irc.callbacks:
|
||||||
|
if cb.name() == 'IRCLogin':
|
||||||
|
before.append(cb)
|
||||||
|
return (before, [])
|
||||||
|
|
||||||
|
def inFilter(self, irc, msg):
|
||||||
|
if not msg.command == 'PRIVMSG':
|
||||||
|
return msg
|
||||||
|
if not conf.supybot.defaultIgnore():
|
||||||
|
return msg
|
||||||
|
s = callbacks.addressed(irc.nick, msg)
|
||||||
|
if not s:
|
||||||
|
return msg
|
||||||
|
if checkIgnored(msg.prefix):
|
||||||
|
return msg
|
||||||
|
try:
|
||||||
|
id = ircdb.users.getUserId(msg.prefix)
|
||||||
|
user = users.getUser(id)
|
||||||
|
return msg
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
cmd, args = (s.split(None, 1) + [None])[:2]
|
||||||
|
if cmd and cmd[0] in str(conf.supybot.reply.whenAddressedBy.chars.get(msg.args[0])):
|
||||||
|
cmd = cmd[1:]
|
||||||
|
if cmd in self.listCommands():
|
||||||
|
tokens = callbacks.tokenize(s, channel=msg.args[0])
|
||||||
|
self.Proxy(irc, msg, tokens)
|
||||||
|
return msg
|
||||||
|
# self._callCommand([cmd], irc, msg, [])
|
||||||
Class = Mess
|
Class = Mess
|
||||||
|
|
|
@ -216,4 +216,37 @@ class Webcal(callbacks.Plugin):
|
||||||
url = self.registryValue('url', c)
|
url = self.registryValue('url', c)
|
||||||
irc.reply("The topic of %s is managed by me and filled with the contents of %s - please don't change manually" %
|
irc.reply("The topic of %s is managed by me and filled with the contents of %s - please don't change manually" %
|
||||||
(msg.args[0],url), private=True)
|
(msg.args[0],url), private=True)
|
||||||
|
|
||||||
|
def callPrecedence(self, irc):
|
||||||
|
before = []
|
||||||
|
for cb in irc.callbacks:
|
||||||
|
if cb.name() == 'IRCLogin':
|
||||||
|
before.append(cb)
|
||||||
|
return (before, [])
|
||||||
|
|
||||||
|
def inFilter(self, irc, msg):
|
||||||
|
if not msg.command == 'PRIVMSG':
|
||||||
|
return msg
|
||||||
|
if not conf.supybot.defaultIgnore():
|
||||||
|
return msg
|
||||||
|
s = callbacks.addressed(irc.nick, msg)
|
||||||
|
if not s:
|
||||||
|
return msg
|
||||||
|
if checkIgnored(msg.prefix):
|
||||||
|
return msg
|
||||||
|
try:
|
||||||
|
id = ircdb.users.getUserId(msg.prefix)
|
||||||
|
user = users.getUser(id)
|
||||||
|
return msg
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
cmd, args = (s.split(None, 1) + [None])[:2]
|
||||||
|
if cmd and cmd[0] in str(conf.supybot.reply.whenAddressedBy.chars.get(msg.args[0])):
|
||||||
|
cmd = cmd[1:]
|
||||||
|
if cmd in self.listCommands():
|
||||||
|
tokens = callbacks.tokenize(s, channel=msg.args[0])
|
||||||
|
self.Proxy(irc, msg, tokens)
|
||||||
|
return msg
|
||||||
|
# self._callCommand([cmd], irc, msg, [])
|
||||||
|
|
||||||
Class = Webcal
|
Class = Webcal
|
||||||
|
|
Loading…
Reference in New Issue