Remove even more stupid code

This commit is contained in:
Kgothatso Ngako
2026-05-02 03:24:31 +02:00
parent fa8855fe1e
commit 30cd04680c
5 changed files with 12 additions and 6 deletions

View File

@@ -38,6 +38,12 @@ data class LocalInReplyToNostrEvent(
)
val profile: Profile?,
@Relation(
entity = Mention::class,
parentColumn = "inReplyToNostrEventId",
entityColumn = "mentioningNostrEventId",
)
val mentionedProfiles: List<LocalMention> = emptyList(),
) {
@Composable
fun RenderNotePreview() {

View File

@@ -43,7 +43,7 @@ data class LocalQuotedNostrEvent(
parentColumn = "quotedNostrEventId",
entityColumn = "mentioningNostrEventId",
)
val mentionedProfiles: List<LocalMention?>? = emptyList(),
val mentionedProfiles: List<LocalMention> = emptyList(),
) {
@Composable
fun RenderNotePreview() {

View File

@@ -43,7 +43,7 @@ data class LocalRepostedNostrEvent(
parentColumn = "repostedNostrEventId",
entityColumn = "mentioningNostrEventId",
)
val mentionedProfiles: List<LocalMention>? = emptyList(),
val mentionedProfiles: List<LocalMention> = emptyList(),
) {
@Composable
fun RenderNotePreview() {

View File

@@ -35,7 +35,7 @@ import coil3.compose.AsyncImage
fun RichContent(
nostrEvent: NostrEvent,
localQuotedNostrEvent: LocalQuotedNostrEvent?,
mentionedProfiles: List<LocalMention?>?,
mentionedProfiles: List<LocalMention>,
style: TextStyle = MaterialTheme.typography.bodyLarge,
color: Color = MaterialTheme.colorScheme.onSurface,
linkColor: Color = Color.Unspecified,
@@ -110,10 +110,10 @@ fun RichContent(
val profileNames = remember(profilePubkeys) {
val names = mutableMapOf<String, String>()
if (mentionedProfiles?.isNotEmpty() == true) {
if (mentionedProfiles.isNotEmpty()) {
Logger.withTag("RichContent").d("mentionedProfiles: ${mentionedProfiles}")
for (pubkey in profilePubkeys) {
val mentionedProfile = mentionedProfiles?.find { mentionedProfile -> mentionedProfile?.profile?.publicKey == pubkey }
val mentionedProfile = mentionedProfiles.find { mentionedProfile -> mentionedProfile.profile?.publicKey == pubkey }
names[pubkey] = mentionedProfile?.profile?.humanReadableNameOrPubkey()
?: "${pubkey.take(8)}...${pubkey.takeLast(4)}"
}

View File

@@ -36,7 +36,7 @@ internal fun TextNoteFeedItem(
profile: Profile?,
localInReplyToNostrEvent: LocalInReplyToNostrEvent?,
localQuotedNostrEvent: LocalQuotedNostrEvent?,
mentionedProfiles: List<LocalMention?>?,
mentionedProfiles: List<LocalMention>,
onNavigateToEvent: (HexKey) -> Unit
) {
if (localInReplyToNostrEvent != null) {