Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions bindings/matrix-sdk-ffi/src/room/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use crate::{
runtime::get_runtime_handle,
timeline::{
configuration::{TimelineConfiguration, TimelineFilter},
EventTimelineItem, LatestEventValue, ReceiptType, SendHandle, Timeline,
LatestEventValue, ReceiptType, SendHandle, Timeline,
},
utils::{u64_to_uint, AsyncRuntimeDropped},
TaskHandle,
Expand Down Expand Up @@ -300,12 +300,8 @@ impl Room {
.unwrap_or(false)
}

async fn latest_event(&self) -> Option<EventTimelineItem> {
self.inner.latest_event_item().await.map(Into::into)
}

async fn new_latest_event(&self) -> LatestEventValue {
self.inner.new_latest_event().await.into()
async fn latest_event(&self) -> LatestEventValue {
self.inner.latest_event().await.into()
}

pub async fn latest_encryption_state(&self) -> Result<EncryptionState, ClientError> {
Expand Down
25 changes: 2 additions & 23 deletions crates/matrix-sdk-base/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,35 +597,14 @@ impl BaseClient {
let mut context = Context::new(StateChanges::new(response.next_batch.clone()));

#[cfg(feature = "e2e-encryption")]
let to_device = {
let processors::e2ee::to_device::Output {
processed_to_device_events: to_device,
room_key_updates,
} = processors::e2ee::to_device::from_sync_v2(
let processors::e2ee::to_device::Output { processed_to_device_events: to_device, .. } =
processors::e2ee::to_device::from_sync_v2(
&response,
olm_machine.as_ref(),
&self.decryption_settings,
)
.await?;

processors::latest_event::decrypt_from_rooms(
&mut context,
room_key_updates
.into_iter()
.flatten()
.filter_map(|room_key_info| self.get_room(&room_key_info.room_id))
.collect(),
processors::e2ee::E2EE::new(
olm_machine.as_ref(),
&self.decryption_settings,
self.handle_verification_events,
),
)
.await?;

to_device
};

#[cfg(not(feature = "e2e-encryption"))]
let to_device = response
.to_device
Expand Down
Loading
Loading