Add logging in _should_heartbeat

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2022-03-10 14:23:43 +01:00
parent a6ce12c0b3
commit 488c254523
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -549,8 +549,16 @@ class XEP_0384(BasePlugin):
length = await self._omemo().receiving_chain_length(jid.bare, device_id)
inactive_session = (length or 0) > self.heartbeat_after
log.debug(
'Chain length for %r / %d: %d -> inactive_session? %r',
jid, device_id, length, inactive_session,
)
log.debug('Is this a prekey message: %r', prekey)
return prekey or inactive_session
res = prekey or inactive_session
log.debug('Should heartbeat? %r', res)
return res
async def should_heartbeat(self, jid: JID, msg: Union[Message, Encrypted]) -> bool:
"""