diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupListScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupListScreen.kt index 1f137c9d4..1f4b1f838 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupListScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupListScreen.kt @@ -148,13 +148,17 @@ fun MarmotGroupListScreen( if (visibleGroups.isEmpty()) { Box( - modifier = Modifier.fillMaxSize(), + modifier = + Modifier + .fillMaxSize() + .padding(horizontal = 32.dp), contentAlignment = Alignment.Center, ) { Column(horizontalAlignment = Alignment.CenterHorizontally) { Text( text = if (selectedTab == 0) "No groups yet" else "No invitations", style = MaterialTheme.typography.titleMedium, + textAlign = TextAlign.Center, ) Text( text = @@ -165,6 +169,7 @@ fun MarmotGroupListScreen( }, style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant, + textAlign = TextAlign.Center, modifier = Modifier.padding(top = 4.dp), ) } diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/marmotGroups/MarmotGroupList.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/marmotGroups/MarmotGroupList.kt index 6ea5bd58d..30d693085 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/marmotGroups/MarmotGroupList.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/marmotGroups/MarmotGroupList.kt @@ -46,8 +46,17 @@ class MarmotGroupList( msg: Note, ) { val chatroom = getOrCreateGroup(nostrGroupId) - if (chatroom.addMessageSync(msg)) { - if (msg.author?.pubkeyHex == ownerPubKey) { + val isSelfAuthored = msg.author?.pubkeyHex == ownerPubKey + // Use the quiet path for our own messages so the relay round-trip + // doesn't mark the user's own outgoing message as unread. + val added = + if (isSelfAuthored) { + chatroom.restoreMessageSync(msg) + } else { + chatroom.addMessageSync(msg) + } + if (added) { + if (isSelfAuthored) { chatroom.ownerSentMessage = true } _groupListChanges.tryEmit(nostrGroupId)