summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-07-17 19:08:02 +0100
committerGitHub <noreply@github.com>2019-07-17 19:08:02 +0100
commit9c70a02a9cddf36521c3d6ae6f72e3b46a5f4c2d (patch)
tree832fb0a1fa57b763d5cdd4079d85d55f4c1be965 /synapse/storage
parentImprove `Depends` specs in debian package. (#5675) (diff)
downloadsynapse-9c70a02a9cddf36521c3d6ae6f72e3b46a5f4c2d.tar.xz
Ignore redactions of m.room.create events (#5701)
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/events_worker.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/storage/events_worker.py b/synapse/storage/events_worker.py
index 1d969d70be..858fc755a1 100644
--- a/synapse/storage/events_worker.py
+++ b/synapse/storage/events_worker.py
@@ -259,6 +259,14 @@ class EventsWorkerStore(SQLBaseStore):
                     continue
 
                 original_event = original_event_entry.event
+                if original_event.type == EventTypes.Create:
+                    # we never serve redactions of Creates to clients.
+                    logger.info(
+                        "Withholding redaction %s of create event %s",
+                        event_id,
+                        redacted_event_id,
+                    )
+                    continue
 
                 if entry.event.internal_metadata.need_to_check_redaction():
                     original_domain = get_domain_from_id(original_event.sender)
@@ -617,6 +625,10 @@ class EventsWorkerStore(SQLBaseStore):
             Deferred[EventBase|None]: if the event should be redacted, a pruned
                 event object. Otherwise, None.
         """
+        if original_ev.type == "m.room.create":
+            # we choose to ignore redactions of m.room.create events.
+            return None
+
         redaction_map = yield self._get_events_from_cache_or_db(redactions)
 
         for redaction_id in redactions: