From ef7aa3b9b3879c2b51d65768925e64dc8c2fc2da Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 2 May 2025 11:18:10 +0300 Subject: [PATCH] Make sure we update the push notification badge using the received, server-provided unread count. --- NSE/Sources/NotificationHandler.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NSE/Sources/NotificationHandler.swift b/NSE/Sources/NotificationHandler.swift index 4b9ed6f16..3aca9c2d5 100644 --- a/NSE/Sources/NotificationHandler.swift +++ b/NSE/Sources/NotificationHandler.swift @@ -42,6 +42,9 @@ class NotificationHandler { func processEvent(_ eventID: String, roomID: String) async { MXLog.info("\(tag) Processing event: \(eventID) in room: \(roomID)") + // Copy over the unread information to the notification badge + notificationContent.badge = NSNumber(value: notificationContent.unreadCount) + guard let notificationItemProxy = await userSession.notificationItemProxy(roomID: roomID, eventID: eventID) else { MXLog.error("\(tag) Failed retrieving notification item") discardNotification()