Skip to content

Commit d1b8f31

Browse files
authored
Merge pull request #5192 from frebib/frebib/conversation-notification
Set shortcut ID on received notifications to make them appear as a Conversation
2 parents 1876a53 + 9c028c9 commit d1b8f31

File tree

1 file changed

+4
-1
lines changed
  • libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/factories

1 file changed

+4
-1
lines changed

libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt

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

0 commit comments

Comments
 (0)