mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-10-15 14:00:00 +00:00
fix: Don't insert top-level redacts in v11+ rooms
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user