Log whether a notification is expected to make a noise. (#3782)

* Log whether a notification is expected to make a noise.

* Also log the system notification sound setting too.
This commit is contained in:
Doug
2025-02-11 09:59:46 +00:00
committed by GitHub
parent 8680d8437b
commit f6a1d38972
5 changed files with 74 additions and 1 deletions
+5 -1
View File
@@ -53,16 +53,20 @@ struct NotificationContentBuilder {
func baseMutableContent(for notificationItem: NotificationItemProxyProtocol) -> UNMutableNotificationContent {
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
notification.threadIdentifier = "\(notificationItem.receiverID)\(notificationItem.roomID)".replacingOccurrences(of: "@", with: "")
MXLog.info("isNoisy: \(notificationItem.isNoisy)")
notification.sound = notificationItem.isNoisy ? UNNotificationSound(named: UNNotificationSoundName(rawValue: "message.caf")) : nil
return notification
}