slight improvements to windows and darwin notifs

This commit is contained in:
Henry Hiles 2026-10-18 16:14:00 -04:00
commit e24e99fd8e
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 13 additions and 4 deletions

View file

@ -116,6 +116,7 @@ class NotificationController
bool isGroup = false, bool isGroup = false,
bool sound = true, bool sound = true,
DateTime? timestamp, DateTime? timestamp,
String? threadId,
}) async { }) async {
debugPrint("Sending notification for $id"); debugPrint("Sending notification for $id");
@ -160,7 +161,10 @@ class NotificationController
.onError((_, _) => null) .onError((_, _) => null)
: null; : null;
final darwin = DarwinNotificationDetails(presentSound: sound); final darwin = DarwinNotificationDetails(
presentSound: sound,
threadIdentifier: threadId,
);
final notificationDetails = NotificationDetails( final notificationDetails = NotificationDetails(
android: .new( android: .new(
"messages", "messages",
@ -188,11 +192,15 @@ class NotificationController
], ],
), ),
), ),
// TODO: See if icons can be added to iOS, macOS, and Windows
// notifications (#68)
iOS: darwin, iOS: darwin,
macOS: darwin, macOS: darwin,
windows: .new(audio: sound ? null : .silent()), windows: .new(
audio: sound ? null : .silent(),
timestamp: timestamp,
header: threadId == null
? null
: .new(id: threadId, title: title, arguments: payload ?? ""),
),
); );
await controller.show( await controller.show(

View file

@ -127,6 +127,7 @@ class UnifiedPushController extends AsyncNotifier<String?> {
isGroup: !notification.isDm, isGroup: !notification.isDm,
sound: notification.sound, sound: notification.sound,
timestamp: notification.timestamp, timestamp: notification.timestamp,
threadId: notification.roomId,
); );
if (isInBackground) exit(0); if (isInBackground) exit(0);