From 2ec257d60849fd8e3065936e69f8d3f0e5bc34fb Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 5 Jul 2024 04:56:52 -0600 Subject: 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. --- synapse/handlers/deactivate_account.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'synapse/handlers/deactivate_account.py') 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", -- cgit 1.5.1