Add a subtreat method in modulecontext
This feature allows module to call the message treatment process on a crafted message
This commit is contained in:
parent
a6a10b78d1
commit
ff2911dbd3
1 changed files with 5 additions and 0 deletions
|
@ -76,6 +76,8 @@ class ModuleContext:
|
||||||
yield i
|
yield i
|
||||||
else:
|
else:
|
||||||
yield res
|
yield res
|
||||||
|
def subtreat(msg):
|
||||||
|
yield from context.treater.treat_msg(msg)
|
||||||
def add_event(evt, eid=None):
|
def add_event(evt, eid=None):
|
||||||
return context.add_event(evt, eid, module_src=module)
|
return context.add_event(evt, eid, module_src=module)
|
||||||
def del_event(evt):
|
def del_event(evt):
|
||||||
|
@ -104,6 +106,8 @@ class ModuleContext:
|
||||||
def call_hook(store, msg):
|
def call_hook(store, msg):
|
||||||
# TODO: what can we do here?
|
# TODO: what can we do here?
|
||||||
return None
|
return None
|
||||||
|
def subtreat(msg):
|
||||||
|
return None
|
||||||
def add_event(evt, eid=None):
|
def add_event(evt, eid=None):
|
||||||
return context.add_event(evt, eid, module_src=module)
|
return context.add_event(evt, eid, module_src=module)
|
||||||
def del_event(evt):
|
def del_event(evt):
|
||||||
|
@ -122,6 +126,7 @@ class ModuleContext:
|
||||||
self.save = save
|
self.save = save
|
||||||
self.send_response = send_response
|
self.send_response = send_response
|
||||||
self.call_hook = call_hook
|
self.call_hook = call_hook
|
||||||
|
self.subtreat = subtreat
|
||||||
|
|
||||||
|
|
||||||
def unload(self):
|
def unload(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue