From baf29cb05f4a84d2a590666d15c7c0cffac116ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 17 Jul 2021 03:39:48 +0200 Subject: [PATCH] should_heartbeat: correctly return what last commit said 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index e736017..b885d8b 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -557,7 +557,7 @@ class XEP_0384(BasePlugin): receiving_chain_lengths = self._chain_lengths(jid).get('receiving', []) lengths = map(lambda d_l: d_l[1], receiving_chain_lengths) min_length = reduce(lambda x, d_l: min(x, d_l[1]), receiving_chain_lengths, 0) == -1 - return min_length or max(lengths, default=0) > self.heartbeat_after + return min_length == -1 or max(lengths, default=0) > self.heartbeat_after async def make_heartbeat(self, jid: JID) -> Message: """