Add channel verification before read and parse a message

This commit is contained in:
Némunaire 2012-06-19 21:40:59 +02:00
parent 0ceb475008
commit df4caf2e74
2 changed files with 4 additions and 3 deletions

View File

@ -166,7 +166,7 @@ class Message:
#Try modules #Try modules
else: else:
for im in mods: for im in mods:
if im.has_access(self) im.parseask(self): if im.has_access(self) and im.parseask(self):
return return
#Owner commands #Owner commands
@ -221,12 +221,12 @@ class Message:
else: else:
for im in mods: for im in mods:
if im.parseanswer(self): if im.has_access(self) and im.parseanswer(self):
return return
else: else:
for im in mods: for im in mods:
if im.parselisten(self): if im.has_access(self) and im.parselisten(self):
return return
# def parseOwnerCmd(self, cmd): # def parseOwnerCmd(self, cmd):

View File

@ -119,6 +119,7 @@ def load_module(config, servers):
mod.print = lambda msg: print("[%s] %s"%(mod.name, msg)) mod.print = lambda msg: print("[%s] %s"%(mod.name, msg))
mod.DATAS = xmlparser.parse_file(datas_path + "/" + config["name"] + ".xml") mod.DATAS = xmlparser.parse_file(datas_path + "/" + config["name"] + ".xml")
mod.CONF = config mod.CONF = config
mod.SRVS = servers
mod.has_access = lambda msg: mod_has_access(mod, config, msg) mod.has_access = lambda msg: mod_has_access(mod, config, msg)
mod.save = lambda: mod_save(mod, datas_path, config) mod.save = lambda: mod_save(mod, datas_path, config)