diff --git a/app/src/main/kotlin/io/flamenet/messenger/app/ChatScreens.kt b/app/src/main/kotlin/io/flamenet/messenger/app/ChatScreens.kt index 215cc86..7674faa 100644 --- a/app/src/main/kotlin/io/flamenet/messenger/app/ChatScreens.kt +++ b/app/src/main/kotlin/io/flamenet/messenger/app/ChatScreens.kt @@ -1785,6 +1785,7 @@ fun ColumnScope.ChatScreen( Bubble( line = line, model = model, + myUserId = myUserId, authorName = when { line.mine || chat.group == null -> { @@ -2318,6 +2319,8 @@ private fun ColumnScope.VoiceComposer( private fun Bubble( line: Session.Line, model: MessengerViewModel, + /** Ours, so a private reaction can say which side of it you are on. */ + myUserId: Long = 0L, authorName: String = "", picture: io.flamenet.e2e.Attachment.Ref? = null, ) { @@ -2530,7 +2533,12 @@ private fun Bubble( // should not be mistaken for one the group watched arrive. line.privateReactions.entries.sortedBy { it.key }.forEach { (emoji, who) -> Text( - if (who.size == 1) "$emoji private" else "$emoji ${who.size} private", + run { + // The person who sent it is told who saw it; + // the author is told that nobody else did. + val side = if (myUserId in who) "only them" else "only you" + if (who.size == 1) "$emoji $side" else "$emoji ${who.size} $side" + }, fontSize = 13.sp, color = Palette.SecondaryText, modifier = diff --git a/app/src/test/kotlin/io/flamenet/messenger/app/PrivateReactionSendTest.kt b/app/src/test/kotlin/io/flamenet/messenger/app/PrivateReactionSendTest.kt index c27a090..85803a4 100644 --- a/app/src/test/kotlin/io/flamenet/messenger/app/PrivateReactionSendTest.kt +++ b/app/src/test/kotlin/io/flamenet/messenger/app/PrivateReactionSendTest.kt @@ -73,5 +73,8 @@ class PrivateReactionSendTest { assertTrue(chat.contains("react-private-toggle"), "no way to choose a private reaction") assertTrue(chat.contains("privately = privately")) assertTrue(chat.contains("line.privateReactions.entries"), "private reactions are not drawn") + // The same chip has to read correctly from both sides of it. + assertTrue(chat.contains("\"only them\"")) + assertTrue(chat.contains("\"only you\"")) } }