mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-07 07:27:45 -04:00
ffi(bindings): added is_space to the NotificationRoomInfo (#5907)
Exposes the `is_space` flag to FFI in the `NotificationRoomInfo`, so that a client can tell through a notification if the room that generated it, is a space or not.
This commit is contained in:
@@ -84,6 +84,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
### Features
|
||||
|
||||
- Expose `is_space` in `NotificationRoomInfo`, allowing clients to determine if the room that triggered the notification is a space.
|
||||
- Add push actions to `NotificationItem` and replace `SyncNotification` with `NotificationItem`.
|
||||
([#5835](https://github.com/matrix-org/matrix-rust-sdk/pull/5835))
|
||||
- Add `Client::new_grant_login_with_qr_code_handler` for granting login to a new device by way of
|
||||
|
||||
@@ -967,6 +967,7 @@ impl Client {
|
||||
joined_members_count: room.joined_members_count(),
|
||||
is_encrypted: Some(room.encryption_state().is_encrypted()),
|
||||
is_direct,
|
||||
is_space: room.is_space(),
|
||||
};
|
||||
|
||||
listener.on_notification(
|
||||
|
||||
@@ -36,6 +36,7 @@ pub struct NotificationRoomInfo {
|
||||
pub joined_members_count: u64,
|
||||
pub is_encrypted: Option<bool>,
|
||||
pub is_direct: bool,
|
||||
pub is_space: bool,
|
||||
}
|
||||
|
||||
#[derive(uniffi::Record)]
|
||||
@@ -82,6 +83,7 @@ impl NotificationItem {
|
||||
joined_members_count: item.joined_members_count,
|
||||
is_encrypted: item.is_room_encrypted,
|
||||
is_direct: item.is_direct_message_room,
|
||||
is_space: item.is_space,
|
||||
},
|
||||
is_noisy: item.is_noisy,
|
||||
has_mention: item.has_mention,
|
||||
|
||||
@@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
### Features
|
||||
|
||||
- Expose `is_space` in `NotificationItem`, allowing clients to determine if the room that triggered the notification is a space.
|
||||
- [**breaking**] The `LatestEventValue::Local` type gains 2 new fields: `sender`
|
||||
and `profile`.
|
||||
([#5885](https://github.com/matrix-org/matrix-rust-sdk/pull/5885))
|
||||
|
||||
@@ -881,6 +881,8 @@ pub struct NotificationItem {
|
||||
pub is_direct_message_room: bool,
|
||||
/// Numbers of members who joined the room.
|
||||
pub joined_members_count: u64,
|
||||
/// Is the room a space?
|
||||
pub is_space: bool,
|
||||
|
||||
/// Is it a noisy notification? (i.e. does any push action contain a sound
|
||||
/// action)
|
||||
@@ -982,6 +984,7 @@ impl NotificationItem {
|
||||
.map(|state| state.is_encrypted())
|
||||
.ok(),
|
||||
joined_members_count: room.joined_members_count(),
|
||||
is_space: room.is_space(),
|
||||
is_noisy,
|
||||
has_mention,
|
||||
thread_id,
|
||||
|
||||
Reference in New Issue
Block a user