1
0
Fork 0

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
else:
for im in mods:
if im.has_access(self) im.parseask(self):
if im.has_access(self) and im.parseask(self):
return
#Owner commands
@ -221,12 +221,12 @@ class Message:
else:
for im in mods:
if im.parseanswer(self):
if im.has_access(self) and im.parseanswer(self):
return
else:
for im in mods:
if im.parselisten(self):
if im.has_access(self) and im.parselisten(self):
return
# 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.DATAS = xmlparser.parse_file(datas_path + "/" + config["name"] + ".xml")
mod.CONF = config
mod.SRVS = servers
mod.has_access = lambda msg: mod_has_access(mod, config, msg)
mod.save = lambda: mod_save(mod, datas_path, config)