Skip to content

Commit fe015b7

Browse files
jmartinespHywan
authored andcommitted
refactor: Expose the new return type of Client::send_call_notifications_if_needed in the FFI layer
1 parent baf6824 commit fe015b7

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

bindings/matrix-sdk-ffi/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file.
88

99
Breaking changes:
1010

11+
- `Client::send_call_notification_if_needed` now returns `Result<bool>` instead of `Result<()>` so we can check if
12+
the event was sent.
1113
- `Client::upload_avatar` and `Timeline::send_attachment` now may fail if a file too large for the homeserver media
1214
config is uploaded.
1315
- `UploadParameters` replaces field `filename: String` with `source: UploadSource`.

bindings/matrix-sdk-ffi/src/room.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -777,9 +777,13 @@ impl Room {
777777
/// It will configure the notify type: ring or notify based on:
778778
/// - is this a DM room -> ring
779779
/// - is this a group with more than one other member -> notify
780-
pub async fn send_call_notification_if_needed(&self) -> Result<(), ClientError> {
781-
self.inner.send_call_notification_if_needed().await?;
782-
Ok(())
780+
///
781+
/// Returns:
782+
/// - `Ok(true)` if the event was successfully sent.
783+
/// - `Ok(false)` if we didn't send it because it was unnecessary.
784+
/// - `Err(_)` if sending the event failed.
785+
pub async fn send_call_notification_if_needed(&self) -> Result<bool, ClientError> {
786+
Ok(self.inner.send_call_notification_if_needed().await?)
783787
}
784788

785789
/// Send a call notification event in the current room.

0 commit comments

Comments
 (0)