Fix PONG response when no registered input treatment

This commit is contained in:
nemunaire 2014-09-04 09:56:53 +02:00
parent b0e457ffc9
commit c32f1579ee

View File

@ -118,11 +118,14 @@ class MessageConsumer:
self.responses = list()
for msg in self.msgs:
for h in hm.get_hooks("in", msg.cmd, msg.qual):
# 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):
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