summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-03-21 12:41:42 +0000
committerErik Johnston <erik@matrix.org>2019-03-21 12:41:42 +0000
commit0f0671e5e08b79364e88b8abbfaf77a304a277a4 (patch)
tree9188b8d2574889cdd6bd3a324dc8cbc44983fa16 /synapse/events
parentMerge pull request #4875 from matrix-org/erikj/spam_checker (diff)
parentMerge pull request #4904 from matrix-org/erikj/fix_shutdown (diff)
downloadsynapse-0f0671e5e08b79364e88b8abbfaf77a304a277a4.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/dinsic-merged
Diffstat (limited to 'synapse/events')
-rw-r--r--synapse/events/__init__.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index 20c1ab4203..fafa135182 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -77,6 +77,20 @@ class _EventInternalMetadata(object):
         """
         return getattr(self, "recheck_redaction", False)
 
+    def is_soft_failed(self):
+        """Whether the event has been soft failed.
+
+        Soft failed events should be handled as usual, except:
+            1. They should not go down sync or event streams, or generally
+               sent to clients.
+            2. They should not be added to the forward extremities (and
+               therefore not to current state).
+
+        Returns:
+            bool
+        """
+        return getattr(self, "soft_failed", False)
+
 
 def _event_dict_property(key):
     # We want to be able to use hasattr with the event dict properties.
@@ -127,7 +141,6 @@ class EventBase(object):
     origin = _event_dict_property("origin")
     origin_server_ts = _event_dict_property("origin_server_ts")
     prev_events = _event_dict_property("prev_events")
-    prev_state = _event_dict_property("prev_state")
     redacts = _event_dict_property("redacts")
     room_id = _event_dict_property("room_id")
     sender = _event_dict_property("sender")