summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2020-01-07 12:08:58 +0000
committerBrendan Abolivier <babolivier@matrix.org>2020-01-07 12:08:58 +0000
commitcd428a93e23e56347957a62ec3d6ca26d6e03a02 (patch)
tree250fcb3593a15e835e3cea1373894785323fd8a9 /synapse/handlers
parentAdded the section 'Configuration' in /docs/turn-howto.md (#6614) (diff)
downloadsynapse-cd428a93e23e56347957a62ec3d6ca26d6e03a02.tar.xz
Fix conditions failing if min_depth = 0
This could result in Synapse not fetching prev_events for new events in the room if it has missed some events.
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/federation.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 72a0febc2b..61b6713c88 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -248,13 +248,13 @@ class FederationHandler(BaseHandler):
             prevs = set(pdu.prev_event_ids())
             seen = await self.store.have_seen_events(prevs)
 
-            if min_depth and pdu.depth < min_depth:
+            if min_depth is not None and pdu.depth < min_depth:
                 # This is so that we don't notify the user about this
                 # message, to work around the fact that some events will
                 # reference really really old events we really don't want to
                 # send to the clients.
                 pdu.internal_metadata.outlier = True
-            elif min_depth and pdu.depth > min_depth:
+            elif min_depth is not None and pdu.depth > min_depth:
                 missing_prevs = prevs - seen
                 if sent_to_us_directly and missing_prevs:
                     # If we're missing stuff, ensure we only fetch stuff one