mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Clear notifications for fully read rooms using the event's timestamp instead of delivery date
This commit is contained in:
@@ -151,7 +151,10 @@ final class NotificationManager: NSObject, NotificationManagerProtocol {
|
||||
return false
|
||||
}
|
||||
|
||||
return notification.date <= lastMessageDate
|
||||
// The delivery date is later than the event's so only use it for notifications without an event date.
|
||||
let notificationDate = notification.request.content.eventDate ?? notification.date
|
||||
// Truncated to seconds to match `RoomSummary.lastMessageDate`.
|
||||
return notificationDate.timeIntervalSince1970.rounded(.down) <= lastMessageDate.timeIntervalSince1970
|
||||
}
|
||||
.map(\.request.identifier)
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ nonisolated enum NotificationConstants {
|
||||
enum UserInfoKey {
|
||||
static let roomIdentifier = "room_id"
|
||||
static let eventIdentifier = "event_id"
|
||||
static let eventDate = "event_date"
|
||||
static let threadRootEventIdentifier = "thread_root_event_id"
|
||||
static let pusherNotificationClientIdentifier = "pusher_notification_client_identifier"
|
||||
static let receiverIdentifier = "receiver_id"
|
||||
|
||||
Reference in New Issue
Block a user