Revert "Open the room live when tapping the notification for its newest message"

This reverts commit 4c71cae0f.

Comparing against other delivered notifications doesn't reflect the timeline:
in rooms set to mentions and keywords, after swiping away newer notifications
or with messages sent from another device, newer messages can exist without a
notification, so the room opened live with the tapped event out of view.
This commit is contained in:
Stefan Ceriu
2026-10-02 15:22:48 +03:00
parent a50c80c179
commit 52b411e954
6 changed files with 14 additions and 50 deletions
@@ -259,21 +259,11 @@ extension NotificationManager: UNUserNotificationCenterDelegate {
content: response.notification.request.content,
replyText: response.userText)
case UNNotificationDefaultActionIdentifier:
await delegate?.notificationTapped(content: response.notification.request.content,
isNewestInRoom: isNewestInRoom(response.notification))
await delegate?.notificationTapped(content: response.notification.request.content)
default:
break
}
}
/// Whether no other delivered notification for the same room is more recent.
private func isNewestInRoom(_ notification: UNNotification) async -> Bool {
guard let roomID = notification.request.content.roomID else { return false }
return await notificationCenter.deliveredNotifications().allSatisfy { deliveredNotification in
deliveredNotification.request.content.roomID != roomID || deliveredNotification.date <= notification.date
}
}
}
extension UNUserNotificationCenter: UserNotificationCenterProtocol { }
@@ -11,8 +11,7 @@ import UserNotifications
protocol NotificationManagerDelegate: AnyObject {
func shouldDisplayInAppNotification(content: UNNotificationContent) -> Bool
/// - Parameter isNewestInRoom: Whether no other delivered notification for the same room is more recent.
func notificationTapped(content: UNNotificationContent, isNewestInRoom: Bool) async
func notificationTapped(content: UNNotificationContent) async
func handleInlineReply(_ service: NotificationManagerProtocol,
content: UNNotificationContent,
replyText: String) async