@@ -168,24 +168,38 @@ private fun NotificationItem(
168168 stringResource(R .string.notification_quote)
169169 )
170170
171+ is Notification .QuotedPostUpdated -> Pair (
172+ Icons .Default .FormatQuote ,
173+ buildMultiActorActionText(
174+ notification = notification,
175+ actionText = stringResource(R .string.notification_quoted_post_updated)
176+ )
177+ )
178+
171179 is Notification .Share -> Pair (
172180 Icons .Default .Repeat ,
173181 stringResource(R .string.notification_share)
174182 )
175183
184+ is Notification .SharedPostUpdated -> Pair (
185+ Icons .Default .Repeat ,
186+ buildMultiActorActionText(
187+ notification = notification,
188+ actionText = stringResource(R .string.notification_shared_post_updated)
189+ )
190+ )
191+
176192 is Notification .React -> {
177- val othersCount = notification.actors.size - 1
178- val prefix = if (othersCount > 0 ) {
179- pluralStringResource(
180- R .plurals.notification_and_others,
181- othersCount,
182- othersCount
183- ) + " "
184- } else " "
185193 val actionStr = if (notification.emoji != null ) {
186- prefix + stringResource(R .string.notification_react_with_emoji, notification.emoji)
194+ buildMultiActorActionText(
195+ notification = notification,
196+ actionText = stringResource(R .string.notification_react_with_emoji, notification.emoji)
197+ )
187198 } else {
188- prefix + stringResource(R .string.notification_react)
199+ buildMultiActorActionText(
200+ notification = notification,
201+ actionText = stringResource(R .string.notification_react)
202+ )
189203 }
190204 Pair (Icons .Default .Favorite , actionStr)
191205 }
@@ -195,7 +209,9 @@ private fun NotificationItem(
195209 is Notification .Mention -> notification.post
196210 is Notification .Reply -> notification.post
197211 is Notification .Quote -> notification.post
212+ is Notification .QuotedPostUpdated -> notification.post
198213 is Notification .Share -> notification.post
214+ is Notification .SharedPostUpdated -> notification.post
199215 is Notification .React -> notification.post
200216 else -> null
201217 }
@@ -278,6 +294,24 @@ private fun NotificationItem(
278294 }
279295}
280296
297+ @Composable
298+ private fun buildMultiActorActionText (
299+ notification : Notification ,
300+ actionText : String
301+ ): String {
302+ val othersCount = notification.actors.size - 1
303+ val prefix = if (othersCount > 0 ) {
304+ pluralStringResource(
305+ R .plurals.notification_and_others,
306+ othersCount,
307+ othersCount
308+ ) + " "
309+ } else {
310+ " "
311+ }
312+ return prefix + actionText
313+ }
314+
281315private fun formatRelativeTime (instant : Instant ): String {
282316 val now = Instant .now()
283317 val duration = Duration .between(instant, now)
0 commit comments