matrix-rust-sdk
matrix-rust-sdk copied to clipboard
Notifications: allow resolving multiple notifications at once
Context : https://github.com/element-hq/element-x-android/issues/2910
The idea would be to expose a new api to resolve multiple notifications. Indeed, currently we are running a lot of sliding sync requests where we could probably run only one with all the rooms subscribed.
The api could looks like that :
pub enum NotificationResult {
Resolved(NotificationItem),
FilteredOut,
Failed(Error),
}
pub async fn get_notifications(
&self,
params: Vec<(RoomId, EventId)>,
) -> Vec<NotificationResult>
We need to make sure the EventId
and RoomId
are available in the NotificationItem
so we can map them back in the client.