summary refs log tree commit diff
path: root/synapse/handlers/admin.py
diff options
context:
space:
mode:
authorShay <hillerys@element.io>2024-10-29 11:50:13 -0700
committerGitHub <noreply@github.com>2024-10-29 13:50:13 -0500
commit58deef5eba68c24987c6b2d95d397ee023a1c6ec (patch)
tree1919e05d32ad7a5dbfc09541a7b5461ca7b8f7a2 /synapse/handlers/admin.py
parentFix check for outdated Rust library (#17861) (diff)
downloadsynapse-58deef5eba68c24987c6b2d95d397ee023a1c6ec.tar.xz
Add admin handler to list of handlers used for background tasks (#17847)
Fixes #17823

While we're at it, makes a change where the redactions are sent as the
admin if the user is not a member of the server (otherwise these fail
with a "User must be our own" message).
Diffstat (limited to 'synapse/handlers/admin.py')
-rw-r--r--synapse/handlers/admin.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/handlers/admin.py b/synapse/handlers/admin.py

index 851fe57a17..d1989e9d2c 100644 --- a/synapse/handlers/admin.py +++ b/synapse/handlers/admin.py
@@ -73,6 +73,8 @@ class AdminHandler: self._redact_all_events, REDACT_ALL_EVENTS_ACTION_NAME ) + self.hs = hs + async def get_redact_task(self, redact_id: str) -> Optional[ScheduledTask]: """Get the current status of an active redaction process @@ -423,8 +425,10 @@ class AdminHandler: user_id = task.params.get("user_id") assert user_id is not None + # puppet the user if they're ours, otherwise use admin to redact requester = create_requester( - user_id, authenticated_entity=admin.user.to_string() + user_id if self.hs.is_mine_id(user_id) else admin.user.to_string(), + authenticated_entity=admin.user.to_string(), ) reason = task.params.get("reason")