summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-06-07 12:28:03 +0100
committerRichard van der Hoff <richard@matrix.org>2018-06-12 09:53:18 +0100
commitb6faef2ad7cf1b427f418441e50c8ca8d7c67b61 (patch)
tree3fbc124e85143a908642f905a62f2a55e5ff7328 /synapse/handlers/federation.py
parentmark accounts as erased when requested (diff)
downloadsynapse-b6faef2ad7cf1b427f418441e50c8ca8d7c67b61.tar.xz
Filter out erased messages
Redact any messges sent by erased users.
Diffstat (limited to '')
-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 a5dee355e1..6f4adf102b 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