summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorTravis Ralston <travisr@element.io>2024-07-05 04:56:52 -0600
committerGitHub <noreply@github.com>2024-07-05 11:56:52 +0100
commit2ec257d60849fd8e3065936e69f8d3f0e5bc34fb (patch)
tree985da9afc4bb620ef9d9ba5771702937ed01974d /synapse
parentFix links in README (#17379) (diff)
downloadsynapse-2ec257d60849fd8e3065936e69f8d3f0e5bc34fb.tar.xz
Upon deactivation, forget all of the user's rooms (#17400)
This can help ensure that the rooms are eventually purged if the other
local users also forget them. Synapse already clears some of the room
information as part of the `_background_remove_left_rooms` background
task, but this doesn't catch `events`, `event_json`, etc.
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/deactivate_account.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/handlers/deactivate_account.py b/synapse/handlers/deactivate_account.py
index 11ac377680..12a7cace55 100644
--- a/synapse/handlers/deactivate_account.py
+++ b/synapse/handlers/deactivate_account.py
@@ -283,6 +283,10 @@ class DeactivateAccountHandler:
                     ratelimit=False,
                     require_consent=False,
                 )
+
+                # Mark the room forgotten too, because they won't be able to do this
+                # for us. This may lead to the room being purged eventually.
+                await self._room_member_handler.forget(user, room_id)
             except Exception:
                 logger.exception(
                     "Failed to part user %r from room %r: ignoring and continuing",