diff --git a/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/database/model/NostrEvent.kt b/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/database/model/NostrEvent.kt index 5e0ad92c..ae78143a 100644 --- a/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/database/model/NostrEvent.kt +++ b/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/database/model/NostrEvent.kt @@ -287,6 +287,7 @@ data class NostrEvent( pubKey = pubKey ) } + companion object { fun fromEvent(event: Event, synchronizeNostrEventRequest: SynchronizeNostrEventRequest? = null): NostrEvent? = try { diff --git a/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/database/repository/DatabaseNostrRepository.kt b/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/database/repository/DatabaseNostrRepository.kt index 950dd375..2dc943a3 100644 --- a/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/database/repository/DatabaseNostrRepository.kt +++ b/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/database/repository/DatabaseNostrRepository.kt @@ -45,6 +45,8 @@ import com.vitorpamplona.quartz.nip10Notes.tags.notify import com.vitorpamplona.quartz.nip10Notes.tags.prepareETagsAsReplyTo import com.vitorpamplona.quartz.nip17Dm.settings.ChatMessageRelayListEvent import com.vitorpamplona.quartz.nip18Reposts.RepostEvent +import com.vitorpamplona.quartz.nip18Reposts.quotes.QEventTag +import com.vitorpamplona.quartz.nip18Reposts.quotes.QTag import com.vitorpamplona.quartz.nip18Reposts.quotes.quotes import com.vitorpamplona.quartz.nip21UriScheme.toNostrUri import com.vitorpamplona.quartz.nip25Reactions.ReactionEvent @@ -245,7 +247,7 @@ class DatabaseNostrRepository( val relayHint = null // TODO: get relyhint from where ever the nostrEvent was synced from... - "\n\n${quotedTextNoteEvent.toNostrUri(relayHint)}" + "\n${quotedTextNoteEvent.toNostrUri(relayHint)}" } ?: "" val text: String = textInput + quotedNostrURI @@ -283,16 +285,21 @@ class DatabaseNostrRepository( quotedNostrEvent?.let { it.profile?.let { profile -> - val ptags = arrayOf( - profile, - // Other profiles tagged in the event... - ).map { notifyProfile -> + val ptags = listOf( PTag( - notifyProfile.publicKey, + profile.publicKey, // TODO: Add relayHints... - ) - } + ), + // Other profiles tagged in the event... + ) + add( + QEventTag.assemble( + eventId = quotedNostrEvent.nostrEvent.id, + relay = null, // TODO: Add relayHints... + author = profile.publicKey + ) + ) notify(ptags) // TODO: ZapForwarding support... diff --git a/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/ui/composable/widgets/feed/EventListView.kt b/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/ui/composable/widgets/feed/EventListView.kt index 69ebd88d..894cb234 100644 --- a/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/ui/composable/widgets/feed/EventListView.kt +++ b/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/ui/composable/widgets/feed/EventListView.kt @@ -181,6 +181,7 @@ private fun TextNoteFeedItem( ) } + // TODO: RichContent here... Text( modifier = Modifier.fillMaxWidth(), text = nostrEvent.content, diff --git a/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/ui/composable/widgets/feed/FeedListItem.kt b/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/ui/composable/widgets/feed/FeedListItem.kt deleted file mode 100644 index 2672cee2..00000000 --- a/composeApp/src/commonMain/kotlin/ac/cord/auxiliary/compose/ui/composable/widgets/feed/FeedListItem.kt +++ /dev/null @@ -1,15 +0,0 @@ -package ac.cord.auxiliary.compose.ui.composable.widgets.feed - -import ac.cord.auxiliary.compose.database.model.intermdiate.LocalNostrEvent -import androidx.compose.runtime.Composable -import com.vitorpamplona.quartz.nip01Core.core.HexKey - -@Composable -fun FeedListItem( - localNostrEvent: LocalNostrEvent, - onNavigateToEvent: (HexKey) -> Unit -) { - localNostrEvent.ListView( - onNavigateToEvent = onNavigateToEvent - ) -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 6f8e6ea6..d0e0f79f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ #Kotlin kotlin.code.style=official -kotlin.daemon.jvmargs=-Xmx3072M +kotlin.daemon.jvmargs=-Xmx12g #Gradle -org.gradle.jvmargs=-Xmx4096M -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx8g -Dfile.encoding=UTF-8 org.gradle.configuration-cache=true org.gradle.caching=true