Commit 7efa1fb8 authored by Maxime Buquet's avatar Maxime Buquet

should_heartbeat: correctly return what last commit said

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <pep@bouah.net>
parent b0fcc82d
Pipeline #4056 passed with stage
......@@ -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:
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment