From 882b4d2294a5d5d1c695dfe99314723ccd8a15c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Thu, 24 Mar 2022 20:00:45 +0100 Subject: [PATCH] Rename make_heartbeat to send_heartbeat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- ChangeLog | 2 ++ slixmpp_omemo/__init__.py | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 632251d..18abf51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Version XXX: * Breaking: - Removed get_device_list method in favor of newly added get_devices and get_active_devices methods. + - Renamed make_heartbeat to send_heartbeat and make it send the message as + well. * Improvements: - Added py.typed to the repository for static type checking tools - New delete_session method diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index 1377198..73da244 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -611,7 +611,7 @@ class XEP_0384(BasePlugin): return await self._should_heartbeat(jid, sid, prekey) - async def make_heartbeat(self, jid: JID, device_id: int) -> Message: + async def send_heartbeat(self, jid: JID, device_id: int) -> None: """ Returns a heartbeat message. @@ -630,7 +630,7 @@ class XEP_0384(BasePlugin): ) msg.append(encrypted) msg.enable('store') - return msg + msg.send() async def delete_session(self, jid: JID, device_id: int) -> None: """ @@ -746,8 +746,7 @@ class XEP_0384(BasePlugin): should_heartbeat = await self._should_heartbeat(sender, sid, isPrekeyMessage) if should_heartbeat: log.debug('Decryption: Sending hearbeat to %s / %d', jid, sid) - msg = await self.make_heartbeat(JID(jid), sid) - msg.send() + await self.send_heartbeat(JID(jid), sid) return body