Fix PONG response when no registered input treatment
This commit is contained in:
parent
b0e457ffc9
commit
c32f1579ee
21
consumer.py
21
consumer.py
@ -118,16 +118,19 @@ class MessageConsumer:
|
||||
|
||||
self.responses = list()
|
||||
for msg in self.msgs:
|
||||
for h in hm.get_hooks("in", msg.cmd, msg.qual):
|
||||
if msg.cmd == "PING":
|
||||
self.srv.write("%s :%s" % ("PONG", msg.params[0]))
|
||||
# TODO: should be placed in server hooks
|
||||
if msg.cmd == "PING":
|
||||
self.srv.write("%s :%s" % ("PONG", msg.params[0]))
|
||||
|
||||
elif h.match(message=msg, server=self.srv):
|
||||
res = h.run(msg)
|
||||
if isinstance(res, list):
|
||||
self.responses += res
|
||||
elif res is not None:
|
||||
self.responses.append(res)
|
||||
else:
|
||||
for h in hm.get_hooks("in", msg.cmd, msg.qual):
|
||||
|
||||
if h.match(message=msg, server=self.srv):
|
||||
res = h.run(msg)
|
||||
if isinstance(res, list):
|
||||
self.responses += res
|
||||
elif res is not None:
|
||||
self.responses.append(res)
|
||||
|
||||
|
||||
def post_treat(self, hm):
|
||||
|
Loading…
Reference in New Issue
Block a user