# HG changeset patch # User Goffi # Date 1585591152 -7200 # Node ID 199fc4c551e92b893811fe85582cf719bb438136 # Parent b0c57c9a4bd8d447929cf10f90a1f4a9e23fd0b3 core (xmpp): use asDeferred for profileConnecting and profileConnected diff -r b0c57c9a4bd8 -r 199fc4c551e9 sat/core/xmpp.py --- a/sat/core/xmpp.py Fri Mar 27 10:02:14 2020 +0100 +++ b/sat/core/xmpp.py Mon Mar 30 19:59:12 2020 +0200 @@ -44,6 +44,7 @@ from sat.memory import encryption from sat.memory import persistent from sat.tools import xml_tools +from sat.tools import utils from sat.tools.common import data_format from zope.interface import implementer @@ -121,7 +122,7 @@ # profile connecting is called right now (before actually starting client) connecting_cb = getattr(plugin, "profileConnecting", None) if connecting_cb is not None: - yield connecting_cb(self) + yield utils.asDeferred(connecting_cb, self) # profile connected is called after client is ready and roster is got connected_cb = getattr(plugin, "profileConnected", None) @@ -236,7 +237,7 @@ # and print error message if any of them fails conn_cb_list = [] for __, callback in plugin_conn_cb: - conn_cb_list.append(defer.maybeDeferred(callback, entity)) + conn_cb_list.append(utils.asDeferred(callback, entity)) list_d = defer.DeferredList(conn_cb_list) def logPluginResults(results):