diff --git a/bindings/matrix-sdk-ffi/CHANGELOG.md b/bindings/matrix-sdk-ffi/CHANGELOG.md index 1dec9d79900..6758544210e 100644 --- a/bindings/matrix-sdk-ffi/CHANGELOG.md +++ b/bindings/matrix-sdk-ffi/CHANGELOG.md @@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file. - Add `Room::load_or_fetch_event` so we can get a `TimelineEvent` given its event id ([#5678](https://github.com/matrix-org/matrix-rust-sdk/pull/5678)). - Add `TimelineEvent::thread_root_event_id` to expose the thread root event id for this type too ([#5678](https://github.com/matrix-org/matrix-rust-sdk/pull/5678)). +- Add `NotificationSettings::get_raw_push_rules` so clients can fetch the raw JSON content of the push rules of the current user and include it in bug reports ([#5706](https://github.com/matrix-org/matrix-rust-sdk/pull/5706)). ## [0.14.0] - 2025-09-04 diff --git a/bindings/matrix-sdk-ffi/src/notification_settings.rs b/bindings/matrix-sdk-ffi/src/notification_settings.rs index 9cce328bfae..a3e2e9d6600 100644 --- a/bindings/matrix-sdk-ffi/src/notification_settings.rs +++ b/bindings/matrix-sdk-ffi/src/notification_settings.rs @@ -11,6 +11,7 @@ use matrix_sdk::{ }; use matrix_sdk_common::{SendOutsideWasm, SyncOutsideWasm}; use ruma::{ + events::push_rules::PushRulesEventContent, push::{ Action as SdkAction, ComparisonOperator as SdkComparisonOperator, PredefinedOverrideRuleId, PredefinedUnderrideRuleId, PushCondition as SdkPushCondition, RoomMemberCountIs, @@ -20,7 +21,7 @@ use ruma::{ }; use tokio::sync::RwLock as AsyncRwLock; -use crate::error::NotificationSettingsError; +use crate::error::{ClientError, NotificationSettingsError}; #[derive(Clone, Default, uniffi::Enum)] pub enum ComparisonOperator { @@ -770,4 +771,11 @@ impl NotificationSettings { .await?; Ok(()) } + + /// Returns the raw push rules in JSON format. + pub async fn get_raw_push_rules(&self) -> Result, ClientError> { + let raw_push_rules = + self.sdk_client.account().account_data::().await?; + Ok(raw_push_rules.map(|raw| serde_json::to_string(&raw)).transpose()?) + } }