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