diff --git a/src/service/rooms/event_handler.rs b/src/service/rooms/event_handler.rs index e88ba3a3..1307e52d 100644 --- a/src/service/rooms/event_handler.rs +++ b/src/service/rooms/event_handler.rs @@ -912,19 +912,22 @@ impl Service { &incoming_pdu.content, )?; - let soft_fail = !state_res::event_auth::auth_check( + let auth_fail_against_current = !state_res::event_auth::auth_check( &ruma_room_version, &incoming_pdu, |k, s| auth_events.get(&(k.clone(), s.to_owned())), ) .map_err(|_e| { Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed.") - })? || incoming_pdu.kind + })?; + + let cannot_redact = incoming_pdu.kind == TimelineEventType::RoomRedaction - && services() + && !services() .rooms .state_accessor .redaction_event_allowed(&incoming_pdu)?; + let soft_fail = auth_fail_against_current || cannot_redact; // 13. Use state resolution to find new room state