summary refs log tree commit diff
path: root/synapse/handlers/deactivate_account.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/deactivate_account.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/deactivate_account.py')
-rw-r--r--synapse/handlers/deactivate_account.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/handlers/deactivate_account.py b/synapse/handlers/deactivate_account.py
index 6116842764..a18d95397c 100644
--- a/synapse/handlers/deactivate_account.py
+++ b/synapse/handlers/deactivate_account.py
@@ -42,7 +42,7 @@ class DeactivateAccountHandler(BaseHandler):
         hs.get_reactor().callWhenRunning(self._start_user_parting)
 
     @defer.inlineCallbacks
-    def deactivate_account(self, user_id):
+    def deactivate_account(self, user_id, erase_data):
         """Deactivate a user's account
 
         Args:
@@ -92,6 +92,11 @@ class DeactivateAccountHandler(BaseHandler):
         # delete from user directory
         yield self.user_directory_handler.handle_user_deactivated(user_id)
 
+        # Mark the user as erased, if they asked for that
+        if erase_data:
+            logger.info("Marking %s as erased", user_id)
+            yield self.store.mark_user_erased(user_id)
+
         # Now start the process that goes through that list and
         # parts users from rooms (if it isn't already running)
         self._start_user_parting()