Skip to content
Merged
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
7 changes: 7 additions & 0 deletions bindings/matrix-sdk-ffi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file.

## [Unreleased] - ReleaseDate

### Features

- [**breaking**]: The new Latest Event API replaces the old API.
`Room::new_latest_event` overwrites the `Room::latest_event` method. See the
documentation of `matrix_sdk::latest_event` to learn about the new API.
[#5624](https://github.com/matrix-org/matrix-rust-sdk/pull/5624/)

## [0.16.0] - 2025-12-04

### Breaking changes
Expand Down
11 changes: 3 additions & 8 deletions bindings/matrix-sdk-ffi/src/room/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ use crate::{
runtime::get_runtime_handle,
timeline::{
configuration::{TimelineConfiguration, TimelineFilter},
AbstractProgress, EventTimelineItem, LatestEventValue, ReceiptType, SendHandle, Timeline,
UploadSource,
AbstractProgress, LatestEventValue, ReceiptType, SendHandle, Timeline, UploadSource,
},
utils::{u64_to_uint, AsyncRuntimeDropped},
TaskHandle,
Expand Down Expand Up @@ -303,12 +302,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 @@ -611,35 +611,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