summary refs log tree commit diff
path: root/synapse/events/__init__.py
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2019-07-18 14:41:42 +0100
committerGitHub <noreply@github.com>2019-07-18 14:41:42 +0100
commitb2a382efdb0cf7b68e194070b616f10732fa0f36 (patch)
treec2723952bb6368de4f884ec94b3361ff51ce5c31 /synapse/events/__init__.py
parentConvert synapse.federation.transport.server to async (#5689) (diff)
downloadsynapse-b2a382efdb0cf7b68e194070b616f10732fa0f36.tar.xz
Remove the ability to query relations when the original event was redacted. (#5629)
Fixes #5594

Forbid viewing relations on an event once it has been redacted.
Diffstat (limited to 'synapse/events/__init__.py')
-rw-r--r--synapse/events/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index d3de70e671..88ed6d764f 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -104,6 +104,17 @@ class _EventInternalMetadata(object):
         """
         return getattr(self, "proactively_send", True)
 
+    def is_redacted(self):
+        """Whether the event has been redacted.
+
+        This is used for efficiently checking whether an event has been
+        marked as redacted without needing to make another database call.
+
+        Returns:
+            bool
+        """
+        return getattr(self, "redacted", False)
+
 
 def _event_dict_property(key):
     # We want to be able to use hasattr with the event dict properties.