Display all reacted emojis

Not just the most common one
This commit is contained in:
Ben Iofel
2026-01-12 02:39:03 -05:00
parent 29c809ac34
commit 7c52fedd89
@@ -402,18 +402,14 @@ class MessagesAdapter @Inject constructor(
val hasReactions = reactions.isNotEmpty() val hasReactions = reactions.isNotEmpty()
if (hasReactions) { if (hasReactions) {
val reactionCounts = reactions.groupBy { it.emoji } val uniqueEmojis = reactions.map { it.emoji }.distinct()
.mapValues { it.value.size } val totalCount = reactions.size
.toList()
.sortedByDescending { it.second } // Sort by count, most reactions first
// For now, show just the first (most popular) reaction // Show unique emojis followed by total count
val topReaction = reactionCounts.first() val reactionText = if (totalCount == 1) {
val reactionText = if (topReaction.second == 1) { uniqueEmojis.first()
topReaction.first
} else { } else {
// Use a non-breaking space to keep the emoji and count together "${uniqueEmojis.joinToString("")}\u00A0$totalCount"
"${topReaction.first}\u00A0${topReaction.second}"
} }
holder.reactionText?.text = reactionText holder.reactionText?.text = reactionText