Make admin api redactions use the requester to send the redaction (#18029)

This commit is contained in:
morguldir 2024-12-23 12:19:35 +01:00 committed by GitHub
parent d69c00b5a1
commit 7c2284b2f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

1
changelog.d/18029.bugfix Normal file
View file

@ -0,0 +1 @@
Fix a bug preventing the admin redaction endpoint from working on messages from remote users.

View file

@ -473,7 +473,7 @@ class AdminHandler:
"type": EventTypes.Redaction, "type": EventTypes.Redaction,
"content": {"reason": reason} if reason else {}, "content": {"reason": reason} if reason else {},
"room_id": room, "room_id": room,
"sender": user_id, "sender": requester.user.to_string(),
} }
if room_version.updated_redaction_rules: if room_version.updated_redaction_rules:
event_dict["content"]["redacts"] = event.event_id event_dict["content"]["redacts"] = event.event_id