From 488c25452362b3b6ec2bf2a2efffc8fc744336bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Thu, 10 Mar 2022 14:23:43 +0100 Subject: [PATCH] Add logging in _should_heartbeat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp_omemo/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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: """