comparison sat/plugins/plugin_xep_0384.py @ 4004:cd6f70015738

plugin XEP-0384: run `profileConnected` workflow in background: XEP-0384 connection workflow can be very long when connecting after a while (due to OLDMEMO migration notably), which can lead to bad UX. It is not necessary to `await` it as `encrypt` and `decrypt` already wait for the plugin to be initialized correctly, so the workflow is now run in background.
author Goffi <goffi@goffi.org>
date Fri, 10 Mar 2023 17:22:45 +0100
parents db45d49518f6
children 1d5a81e3c9e8
comparison
equal deleted inserted replaced
4003:1a77e1f866f9 4004:cd6f70015738
1620 except KeyError: 1620 except KeyError:
1621 log.info(_("Text commands not available")) 1621 log.info(_("Text commands not available"))
1622 else: 1622 else:
1623 self.__text_commands.registerTextCommands(self) 1623 self.__text_commands.registerTextCommands(self)
1624 1624
1625 async def profileConnected( # pylint: disable=invalid-name 1625 def profileConnected( # pylint: disable=invalid-name
1626 self, 1626 self,
1627 client: SatXMPPClient 1627 client: SatXMPPClient
1628 ) -> None: 1628 ) -> None:
1629 """ 1629 """
1630 @param client: The client. 1630 @param client: The client.
1631 """ 1631 """
1632 1632
1633 await self.get_session_manager( 1633 defer.ensureDeferred(self.get_session_manager(
1634 cast(str, client.profile) 1634 cast(str, client.profile)
1635 ) 1635 ))
1636 1636
1637 async def cmd_omemo_reset( 1637 async def cmd_omemo_reset(
1638 self, 1638 self,
1639 client: SatXMPPClient, 1639 client: SatXMPPClient,
1640 mess_data: MessageData 1640 mess_data: MessageData