diff --git a/bindings/matrix-sdk-ffi/src/notification_settings.rs b/bindings/matrix-sdk-ffi/src/notification_settings.rs index c34dddd9d..e5fbeb078 100644 --- a/bindings/matrix-sdk-ffi/src/notification_settings.rs +++ b/bindings/matrix-sdk-ffi/src/notification_settings.rs @@ -176,6 +176,24 @@ impl NotificationSettings { Ok(()) } + /// Get the user defined room notification mode + pub async fn get_user_defined_room_notification_mode( + &self, + room_id: String, + ) -> Result, NotificationSettingsError> { + let notification_settings = self.sdk_notification_settings.read().await; + let parsed_room_id = RoomId::parse(&room_id) + .map_err(|_e| NotificationSettingsError::InvalidRoomId(room_id))?; + // Get the current user defined mode for this room + if let Some(mode) = + notification_settings.get_user_defined_room_notification_mode(&parsed_room_id).await + { + Ok(Some(mode.into())) + } else { + Ok(None) + } + } + /// Get the default room notification mode /// /// The mode will depend on the associated `PushRule` based on whether the