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
1 change: 1 addition & 0 deletions bindings/matrix-sdk-ffi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 9 additions & 1 deletion bindings/matrix-sdk-ffi/src/notification_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
Expand Down Expand Up @@ -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<Option<String>, ClientError> {
let raw_push_rules =
self.sdk_client.account().account_data::<PushRulesEventContent>().await?;
Ok(raw_push_rules.map(|raw| serde_json::to_string(&raw)).transpose()?)
}
}
Loading