diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt index 6b5954a8a0..7fb3bd12ce 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt @@ -769,6 +769,7 @@ fun InnerNoteWithReactions( unPackReply = unPackReply, accountViewModel = accountViewModel, nav = nav, + isBoostedNote = isBoostedNote, ) if (!makeItShort) { @@ -917,6 +918,7 @@ private fun RenderNoteRow( editState: State>, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { when (val noteEvent = baseNote.event) { is AppDefinitionEvent -> { @@ -1395,6 +1397,7 @@ private fun RenderNoteRow( backgroundColor, accountViewModel, nav, + isBoostedNote = isBoostedNote, ) } @@ -1407,6 +1410,7 @@ private fun RenderNoteRow( backgroundColor, accountViewModel, nav, + isBoostedNote = isBoostedNote, ) } @@ -1419,6 +1423,7 @@ private fun RenderNoteRow( backgroundColor, accountViewModel, nav, + isBoostedNote = isBoostedNote, ) } @@ -1554,6 +1559,7 @@ private fun RenderNoteRow( backgroundColor, accountViewModel, nav, + isBoostedNote = isBoostedNote, ) } @@ -1568,6 +1574,7 @@ private fun RenderNoteRow( editState, accountViewModel, nav, + isBoostedNote = isBoostedNote, ) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Chat.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Chat.kt index a499e28509..e51612e3a7 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Chat.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Chat.kt @@ -49,11 +49,15 @@ fun RenderChat( backgroundColor: MutableState, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { val noteEvent = note.event ?: return val eventContent = remember(noteEvent) { noteEvent.content } - if (makeItShort && accountViewModel.isLoggedUser(note.author)) { + // A boosted note inside a zap/nutzap/onchain activity card is always shown as a + // compact 2-line preview, even when the logged-in user is only a zap-split + // beneficiary (and thus not the author) of the post being zapped. + if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) { Text( text = eventContent, color = MaterialTheme.colorScheme.placeholderText, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Poll.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Poll.kt index 6b7d0896af..0bcc0df398 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Poll.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Poll.kt @@ -116,10 +116,14 @@ fun RenderPoll( backgroundColor: MutableState, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { val noteEvent = note.event as? PollEvent ?: return - if (makeItShort && accountViewModel.isLoggedUser(note.author)) { + // A boosted note inside a zap/nutzap/onchain activity card is always shown as a + // compact 2-line preview, even when the logged-in user is only a zap-split + // beneficiary (and thus not the author) of the post being zapped. + if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) { Text( text = noteEvent.content, color = MaterialTheme.colorScheme.placeholderText, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PublicMessage.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PublicMessage.kt index 73b05b19c8..4fa6b422fa 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PublicMessage.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PublicMessage.kt @@ -55,11 +55,15 @@ fun RenderPublicMessage( backgroundColor: MutableState, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { val noteEvent = note.event as? PublicMessageEvent ?: return val content = remember(noteEvent) { noteEvent.peopleAndContent() } - if (makeItShort && accountViewModel.isLoggedUser(note.author)) { + // A boosted note inside a zap/nutzap/onchain activity card is always shown as a + // compact 2-line preview, even when the logged-in user is only a zap-split + // beneficiary (and thus not the author) of the post being zapped. + if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) { Text( text = content, color = MaterialTheme.colorScheme.placeholderText, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Text.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Text.kt index c082b39990..49c0aaf890 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Text.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Text.kt @@ -79,6 +79,7 @@ fun RenderTextEvent( editState: State>, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { val noteEvent = note.event ?: return @@ -183,7 +184,10 @@ fun RenderTextEvent( } } - if (makeItShort && accountViewModel.isLoggedUser(note.author)) { + // A boosted note inside a zap/nutzap/onchain activity card is always shown as a + // compact 2-line preview, even when the logged-in user is only a zap-split + // beneficiary (and thus not the author) of the post being zapped. + if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) { Text( text = eventContent, color = MaterialTheme.colorScheme.placeholderText, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapPoll.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapPoll.kt index 48847aa61b..d99aa11976 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapPoll.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapPoll.kt @@ -60,6 +60,7 @@ fun RenderZapPoll( backgroundColor: MutableState, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { val noteEvent = note.event as? ZapPollEvent ?: return val eventContent = noteEvent.content @@ -92,7 +93,10 @@ fun RenderZapPoll( } } - if (makeItShort && accountViewModel.isLoggedUser(note.author)) { + // A boosted note inside a zap/nutzap/onchain activity card is always shown as a + // compact 2-line preview, even when the logged-in user is only a zap-split + // beneficiary (and thus not the author) of the post being zapped. + if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) { Text( text = eventContent, color = MaterialTheme.colorScheme.placeholderText,