Remove delivered notifications if their event gets redacted. (#3191)

This commit is contained in:
Doug
2024-08-22 13:49:00 +01:00
committed by GitHub
parent a1cb6bd376
commit d54e08e815
4 changed files with 54 additions and 10 deletions
@@ -63,6 +63,10 @@ struct NotificationContentBuilder {
let notification = UNMutableNotificationContent()
notification.receiverID = notificationItem.receiverID
notification.roomID = notificationItem.roomID
notification.eventID = switch notificationItem.event {
case .timeline(let event): event.eventId()
case .invite, .none: nil
}
notification.sound = notificationItem.isNoisy ? UNNotificationSound(named: UNNotificationSoundName(rawValue: "message.caf")) : nil
// So that the UI groups notification that are received for the same room but also for the same user
// Removing the @ fixes an iOS bug where the notification crashes if the mute button is tapped