diff options
author | Erik Johnston <erik@matrix.org> | 2019-02-12 10:31:21 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-03-06 16:22:16 +0000 |
commit | a9de04be724be9e19af0a5a5839c65924f90886a (patch) | |
tree | 2a3abf94c400b64173876b797e413342ba061c53 /synapse/events/__init__.py | |
parent | Merge pull request #4772 from jbweston/jbweston/server-version-api (diff) | |
download | synapse-a9de04be724be9e19af0a5a5839c65924f90886a.tar.xz |
Implement soft fail
Diffstat (limited to 'synapse/events/__init__.py')
-rw-r--r-- | synapse/events/__init__.py | 14 |
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. |