fix: Don't insert top-level redacts in v11+ rooms

This commit is contained in:
timedout
2026-10-06 02:34:10 +00:00
committed by Ellis Git
parent 1ffb1d637e
commit 20fe43d200
+9 -1
View File
@@ -190,9 +190,17 @@ pub async fn create_event(
}
}
}
let redacts = match redacts {
// If this isn't a real redaction event, there's no redacts field.
| _ if event_type != TimelineEventType::RoomRedaction || state_key.is_some() => None,
// If the redaction is itself in the event content, we don't set the top-level field.
| Some(_) if room_version_rules.redaction.content_field_redacts => None,
// Otherwise, we do if it's present
| other => other,
};
let pdu = PduEvent {
event_id: ruma::event_id!("$thiswillbefilledinlater").into(),
event_id: ruma::owned_event_id!("$thiswillbefilledinlater"),
room_id: room_id.map(ToOwned::to_owned),
sender: sender.to_owned(),
origin: None,