mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user