From 73241939666313b4429ee342dfcc54b529138de7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 3 Apr 2022 20:36:37 +0200 Subject: [PATCH] Don't expose fetch_devices and fetch_bundle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- ChangeLog | 1 - slixmpp_omemo/__init__.py | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 18abf51..c752e1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,7 +8,6 @@ Version XXX: * Improvements: - Added py.typed to the repository for static type checking tools - New delete_session method - - New fetch_devices and fetch_bundle methods Version 0.6.1: 2022-03-14 Maxime “pep” Buquet * Improvements: diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index 73da244..43feea4 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -415,7 +415,7 @@ class XEP_0384(BasePlugin): else: log.debug('Not publishing.') - async def fetch_bundle(self, jid: JID, device_id: int) -> None: + async def _fetch_bundle(self, jid: JID, device_id: int) -> None: """ Fetch bundles for specified jid / device_id pair. """ @@ -435,7 +435,7 @@ class XEP_0384(BasePlugin): else: log.debug('Encryption: Bundle %r not found!', device_id) - async def fetch_devices(self, jid: JID) -> None: + async def _fetch_devices(self, jid: JID) -> None: """ Manually query PEP OMEMO_DEVICES_NS nodes """ @@ -829,10 +829,10 @@ class XEP_0384(BasePlugin): for exn in errors: if isinstance(exn, omemo.exceptions.NoDevicesException): log.debug('Encryption: Missing device list for JID: %r', exn.bare_jid) - await self.fetch_devices(JID(exn.bare_jid)) + await self._fetch_devices(JID(exn.bare_jid)) elif isinstance(exn, omemo.exceptions.MissingBundleException): log.debug('Encryption: Missing bundle for JID: %r, device: %r', exn.bare_jid, exn.device) - await self.fetch_bundle(JID(exn.bare_jid), exn.device) + await self._fetch_bundle(JID(exn.bare_jid), exn.device) elif isinstance(exn, omemo.exceptions.TrustException): # On TrustException, there are two possibilities. # Either trust has not been explicitely set yet, and is