summary refs log tree commit diff
path: root/synapse/events/__init__.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2019-03-08 14:51:06 +0000
committerGitHub <noreply@github.com>2019-03-08 14:51:06 +0000
commit39e57f97286fd0db108656ddf3bfdc9bae91945f (patch)
tree99c0052e1697e74379050ad7af4cef2d62f21c2e /synapse/events/__init__.py
parentMerge pull request #4829 from matrix-org/erikj/device_list_seen_updates (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/soft_fail_... (diff)
downloadsynapse-39e57f97286fd0db108656ddf3bfdc9bae91945f.tar.xz
Merge pull request #4814 from matrix-org/erikj/soft_fail_impl
Implement soft fail
Diffstat (limited to 'synapse/events/__init__.py')
-rw-r--r--synapse/events/__init__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index 20c1ab4203..bd130f8816 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.