Commit 7f300a5b authored by Emmanuel Gil Peyrot's avatar Emmanuel Gil Peyrot

Dispatcher: Fix stanza handler registration

parent 5daadced
Pipeline #5446 passed with stages
in 35 seconds
......@@ -183,7 +183,9 @@ class StanzaDispatcher(Observable):
for instance in self._modules.values():
for handler in instance.handlers:
self.register_handler(*handler)
self.register_handler(handler.name, handler.callback,
handler.typ, handler.ns, handler.xmlns,
handler.priority)
def reset_parser(self):
if self._parser is not None:
......
......@@ -45,9 +45,7 @@ class ActivityTest(StanzaHandlerTest):
</message>
'''
self.dispatcher.register_handler(
*StanzaHandler(name='message',
callback=_on_message,
ns=Namespace.PUBSUB_EVENT))
self.dispatcher.register_handler('message', _on_message,
ns=Namespace.PUBSUB_EVENT)
self.dispatcher.process_data(event)
......@@ -50,9 +50,7 @@ class AvatarTest(StanzaHandlerTest):
</message>
'''
self.dispatcher.register_handler(
*StanzaHandler(name='message',
callback=_on_message,
ns=Namespace.PUBSUB_EVENT))
self.dispatcher.register_handler('message', _on_message,
ns=Namespace.PUBSUB_EVENT)
self.dispatcher.process_data(event)
......@@ -61,10 +61,8 @@ class BookmarkTest(StanzaHandlerTest):
</message>
'''
self.dispatcher.register_handler(
*StanzaHandler(name='message',
callback=_on_message,
ns=Namespace.PUBSUB_EVENT))
self.dispatcher.register_handler('message', _on_message,
ns=Namespace.PUBSUB_EVENT)
self.dispatcher.process_data(event)
......@@ -106,9 +104,7 @@ class BookmarkTest(StanzaHandlerTest):
</message>
'''
self.dispatcher.register_handler(
*StanzaHandler(name='message',
callback=_on_message,
ns=Namespace.PUBSUB_EVENT))
self.dispatcher.register_handler('message', _on_message,
ns=Namespace.PUBSUB_EVENT)
self.dispatcher.process_data(event)
......@@ -86,9 +86,7 @@ class LocationTest(StanzaHandlerTest):
</message>
'''
self.dispatcher.register_handler(
*StanzaHandler(name='message',
callback=_on_message,
ns=Namespace.PUBSUB_EVENT))
self.dispatcher.register_handler('message', _on_message,
ns=Namespace.PUBSUB_EVENT)
self.dispatcher.process_data(event)
......@@ -41,9 +41,7 @@ class MoodTest(StanzaHandlerTest):
</message>
'''
self.dispatcher.register_handler(
*StanzaHandler(name='message',
callback=_on_message,
ns=Namespace.PUBSUB_EVENT))
self.dispatcher.register_handler('message', _on_message,
ns=Namespace.PUBSUB_EVENT)
self.dispatcher.process_data(event)
......@@ -29,11 +29,8 @@ class PubsubTest(StanzaHandlerTest):
</message>
'''
self.dispatcher.register_handler(
*StanzaHandler(name='message',
callback=_on_message,
ns=Namespace.PUBSUB_EVENT,
priority=16))
self.dispatcher.register_handler('message', _on_message,
ns=Namespace.PUBSUB_EVENT, priority=16)
self.dispatcher.process_data(event)
......@@ -59,11 +56,8 @@ class PubsubTest(StanzaHandlerTest):
</message>
'''
self.dispatcher.register_handler(
*StanzaHandler(name='message',
callback=_on_message,
ns=Namespace.PUBSUB_EVENT,
priority=16))
self.dispatcher.register_handler('message', _on_message,
ns=Namespace.PUBSUB_EVENT, priority=16)
self.dispatcher.process_data(event)
......@@ -90,10 +84,7 @@ class PubsubTest(StanzaHandlerTest):
</message>
'''
self.dispatcher.register_handler(
*StanzaHandler(name='message',
callback=_on_message,
ns=Namespace.PUBSUB_EVENT,
priority=16))
self.dispatcher.register_handler('message', _on_message,
ns=Namespace.PUBSUB_EVENT, priority=16)
self.dispatcher.process_data(event)
......@@ -52,9 +52,7 @@ class TuneTest(StanzaHandlerTest):
</message>
'''
self.dispatcher.register_handler(
*StanzaHandler(name='message',
callback=_on_message,
ns=Namespace.PUBSUB_EVENT))
self.dispatcher.register_handler('message', _on_message,
ns=Namespace.PUBSUB_EVENT)
self.dispatcher.process_data(event)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment