diff --git a/crates/matrix-sdk-base/src/client.rs b/crates/matrix-sdk-base/src/client.rs index 72dd5ecc4..9c575fb04 100644 --- a/crates/matrix-sdk-base/src/client.rs +++ b/crates/matrix-sdk-base/src/client.rs @@ -973,7 +973,7 @@ impl BaseClient { ) .await?; - processors::decrypt_latest_events( + processors::latest_event::decrypt_from_rooms( &mut context, room_key_updates .into_iter() diff --git a/crates/matrix-sdk-base/src/response_processors/latest_event.rs b/crates/matrix-sdk-base/src/response_processors/latest_event.rs index f13edc3da..b6dfd8af8 100644 --- a/crates/matrix-sdk-base/src/response_processors/latest_event.rs +++ b/crates/matrix-sdk-base/src/response_processors/latest_event.rs @@ -37,7 +37,7 @@ use crate::{ /// If we can decrypt them, change [`Room::latest_event`] to reflect what we /// found, and remove any older encrypted events from /// [`Room::latest_encrypted_events`]. -pub async fn decrypt_latest_events( +pub async fn decrypt_from_rooms( context: &mut Context, rooms: Vec, olm_machine: Option<&OlmMachine>, @@ -52,7 +52,7 @@ pub async fn decrypt_latest_events( // Try to find a message we can decrypt and is suitable for using as the latest // event. If we found one, set it as the latest and delete any older // encrypted events - if let Some((found, found_index)) = decrypt_latest_suitable_event( + if let Some((found, found_index)) = find_suitable_and_decrypt( context, olm_machine, &room, @@ -73,7 +73,7 @@ pub async fn decrypt_latest_events( Ok(()) } -async fn decrypt_latest_suitable_event( +async fn find_suitable_and_decrypt( context: &mut Context, olm_machine: &OlmMachine, room: &Room, @@ -194,7 +194,7 @@ mod tests { }; use ruma::{event_id, events::room::member::MembershipState, room_id, user_id}; - use super::{decrypt_latest_events, Context}; + use super::{decrypt_from_rooms, Context}; use crate::{ rooms::normal::RoomInfoNotableUpdateReasons, test_utils::logged_in_base_client, StateChanges, @@ -232,7 +232,7 @@ mod tests { // When I tell it to do some decryption let mut context = Context::new(StateChanges::default(), Default::default()); - decrypt_latest_events( + decrypt_from_rooms( &mut context, vec![room.clone()], client.olm_machine().await.as_ref(), diff --git a/crates/matrix-sdk-base/src/response_processors/mod.rs b/crates/matrix-sdk-base/src/response_processors/mod.rs index 0bd09922d..5fd1e0fce 100644 --- a/crates/matrix-sdk-base/src/response_processors/mod.rs +++ b/crates/matrix-sdk-base/src/response_processors/mod.rs @@ -23,17 +23,8 @@ pub mod verification; use std::collections::BTreeMap; -#[cfg(feature = "e2e-encryption")] -mod with_e2ee { - pub use super::{ - e2ee::{to_device, tracked_users}, - latest_event::decrypt_latest_events, - verification::verification, - }; -} use ruma::OwnedRoomId; -#[cfg(feature = "e2e-encryption")] -pub use with_e2ee::*; +pub use verification::verification; use crate::{RoomInfoNotableUpdateReasons, StateChanges}; diff --git a/crates/matrix-sdk-base/src/sliding_sync.rs b/crates/matrix-sdk-base/src/sliding_sync.rs index 57103db71..f9b063b6c 100644 --- a/crates/matrix-sdk-base/src/sliding_sync.rs +++ b/crates/matrix-sdk-base/src/sliding_sync.rs @@ -92,7 +92,7 @@ impl BaseClient { ) .await?; - processors::decrypt_latest_events( + processors::latest_event::decrypt_from_rooms( &mut context, room_key_updates .into_iter()