summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-06-25 14:37:01 +0100
committerGitHub <noreply@github.com>2018-06-25 14:37:01 +0100
commit33fdcfa957e64ec43bd866d09e12811140f75dcf (patch)
tree15dc74b7c90fa61cd53dff05eb19676a7bd5d935 /synapse/handlers/federation.py
parentRemove all global reactor imports & pass it around explicitly (#3424) (diff)
parentAdd UserErasureWorkerStore to workers (diff)
downloadsynapse-33fdcfa957e64ec43bd866d09e12811140f75dcf.tar.xz
Merge pull request #3441 from matrix-org/erikj/redo_erasure
Fix user erasure and re-enable
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r--synapse/handlers/federation.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 2571758284..1ca56c2c97 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -495,7 +495,20 @@ class FederationHandler(BaseHandler):
             for e_id, key_to_eid in event_to_state_ids.iteritems()
         }
 
+        erased_senders = yield self.store.are_users_erased(
+            e.sender for e in events,
+        )
+
         def redact_disallowed(event, state):
+            # if the sender has been gdpr17ed, always return a redacted
+            # copy of the event.
+            if erased_senders[event.sender]:
+                logger.info(
+                    "Sender of %s has been erased, redacting",
+                    event.event_id,
+                )
+                return prune_event(event)
+
             if not state:
                 return event