Rename make_heartbeat to send_heartbeat

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2022-03-24 20:00:45 +01:00
parent c8341e0f83
commit 882b4d2294
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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