Rename make_heartbeat to send_heartbeat
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
c8341e0f83
commit
882b4d2294
2 changed files with 5 additions and 4 deletions
|
@ -3,6 +3,8 @@ Version XXX:
|
||||||
* Breaking:
|
* Breaking:
|
||||||
- Removed get_device_list method in favor of newly added get_devices and
|
- Removed get_device_list method in favor of newly added get_devices and
|
||||||
get_active_devices methods.
|
get_active_devices methods.
|
||||||
|
- Renamed make_heartbeat to send_heartbeat and make it send the message as
|
||||||
|
well.
|
||||||
* Improvements:
|
* Improvements:
|
||||||
- Added py.typed to the repository for static type checking tools
|
- Added py.typed to the repository for static type checking tools
|
||||||
- New delete_session method
|
- New delete_session method
|
||||||
|
|
|
@ -611,7 +611,7 @@ class XEP_0384(BasePlugin):
|
||||||
|
|
||||||
return await self._should_heartbeat(jid, sid, prekey)
|
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.
|
Returns a heartbeat message.
|
||||||
|
|
||||||
|
@ -630,7 +630,7 @@ class XEP_0384(BasePlugin):
|
||||||
)
|
)
|
||||||
msg.append(encrypted)
|
msg.append(encrypted)
|
||||||
msg.enable('store')
|
msg.enable('store')
|
||||||
return msg
|
msg.send()
|
||||||
|
|
||||||
async def delete_session(self, jid: JID, device_id: int) -> None:
|
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)
|
should_heartbeat = await self._should_heartbeat(sender, sid, isPrekeyMessage)
|
||||||
if should_heartbeat:
|
if should_heartbeat:
|
||||||
log.debug('Decryption: Sending hearbeat to %s / %d', jid, sid)
|
log.debug('Decryption: Sending hearbeat to %s / %d', jid, sid)
|
||||||
msg = await self.make_heartbeat(JID(jid), sid)
|
await self.send_heartbeat(JID(jid), sid)
|
||||||
msg.send()
|
|
||||||
|
|
||||||
return body
|
return body
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue