Merge pull request #5192 from frebib/frebib/conversation-notification

Set shortcut ID on received notifications to make them appear as a Conversation
This commit is contained in:
Benoit Marty 2025-09-09 08:52:32 +02:00 committed by GitHub
commit d1b8f31d5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -137,7 +137,10 @@ class DefaultNotificationCreator(
// that can be displayed in not disturb mode if white listed (the later will need compat28.x)
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
// ID of the corresponding shortcut, for conversation features under API 30+
.setShortcutId(roomInfo.roomId.value)
// Must match those created in the ShortcutInfoCompat.Builder()
// for the notification to appear as a "Conversation":
// https://developer.android.com/develop/ui/views/notifications/conversations
.setShortcutId("${roomInfo.sessionId.value}-${roomInfo.roomId.value}")
// Auto-bundling is enabled for 4 or more notifications on API 24+ (N+)
// devices and all Wear devices. But we want a custom grouping, so we specify the groupID
.setGroup(roomInfo.sessionId.value)