should_heartbeat: correctly return what last commit said
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
c7a0a092d4
commit
baf29cb05f
1 changed files with 1 additions and 1 deletions
|
@ -557,7 +557,7 @@ class XEP_0384(BasePlugin):
|
||||||
receiving_chain_lengths = self._chain_lengths(jid).get('receiving', [])
|
receiving_chain_lengths = self._chain_lengths(jid).get('receiving', [])
|
||||||
lengths = map(lambda d_l: d_l[1], receiving_chain_lengths)
|
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
|
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:
|
async def make_heartbeat(self, jid: JID) -> Message:
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue