diff --git a/ChangeLog b/ChangeLog index a1bcbe3..d67fcc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ Version xxx: 2022-xx-xx Maxime “pep” Buquet * Added: - Coroutines in asyncio.wait is now deprecated. Added create_task calls + - Replaced all ensure_future calls by create_task Version 0.8.0: 2022-08-23 Maxime “pep” Buquet * Breaking: diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index bca8094..1eb7b53 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -236,7 +236,7 @@ class XEP_0384(BasePlugin): "no data directory specified.") self._device_id = _load_device_id(self.data_dir) - asyncio.ensure_future(self.session_start_omemo()) + asyncio.create_task(self.session_start_omemo()) self.xmpp.add_event_handler('session_start', self.session_start) self.xmpp['xep_0060'].map_node_event(OMEMO_DEVICES_NS, 'omemo_device_list') @@ -245,7 +245,7 @@ class XEP_0384(BasePlugin): # If this plugin is loaded after 'session_start' has fired, we still # need to publish bundles if self.xmpp.is_connected and not self._initial_publish_done: - asyncio.ensure_future(self._initial_publish()) + asyncio.create_task(self._initial_publish()) def plugin_end(self): if not self.backend_loaded: @@ -469,7 +469,7 @@ class XEP_0384(BasePlugin): def _receive_device_list(self, msg: Message) -> None: """Handler for received PEP OMEMO_DEVICES_NS payloads""" - asyncio.ensure_future( + asyncio.create_task( self._read_device_list(msg['from'], msg['pubsub_event']['items']), ) @@ -755,7 +755,7 @@ class XEP_0384(BasePlugin): raise UntrustedException(exn.bare_jid, exn.device, exn.ik) raise finally: - asyncio.ensure_future(self._publish_bundle()) + asyncio.create_task(self._publish_bundle()) if self.auto_heartbeat: log.debug('Checking if heartbeat is required. auto_hearbeat enabled.')