diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index 55e9293..03f803d 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -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: """