summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-06-17 18:04:42 +0100
committerErik Johnston <erik@matrix.org>2019-06-18 15:02:18 +0100
commitb42f90470f00831bfd9b7ebca19111ed229599b0 (patch)
tree9e6a7011d237f4149567fb3e2cf2e32b39879d11 /synapse/events
parentMerge pull request #5385 from matrix-org/erikj/reduce_http_exceptions (diff)
downloadsynapse-b42f90470f00831bfd9b7ebca19111ed229599b0.tar.xz
Add experimental option to reduce extremities.
Adds new config option `cleanup_extremities_with_dummy_events` which
periodically sends dummy events to rooms with more than 10 extremities.

THIS IS REALLY EXPERIMENTAL.
Diffstat (limited to 'synapse/events')
-rw-r--r--synapse/events/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index 1edd19cc13..f1fbb3d14a 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -92,6 +92,18 @@ class _EventInternalMetadata(object):
         """
         return getattr(self, "soft_failed", False)
 
+    def should_proactively_send(self):
+        """Whether the eventm, if ours, should be sent to other clients and
+        servers.
+
+        This is used for sending dummy events internally. Servers and clients
+        can still explicitly fetch the event.
+
+        Returns:
+            bool
+        """
+        return getattr(self, "proactively_send", True)
+
 
 def _event_dict_property(key):
     # We want to be able to use hasattr with the event dict properties.