Add mentioned profiles on quoted/reposted/inreply to

This commit is contained in:
Kgothatso Ngako committed 2026-05-01 19:28:03 +02:00
1 parent a5e5bd25ae
commit 755e91bbd5
5 files changed
+22 -22

No files matched your search

@@ -1,6 +1,7 @@
package ac.cord.auxiliary.compose.database.model.intermdiate
import ac.cord.auxiliary.compose.database.model.InReplyToRelation
import ac.cord.auxiliary.compose.database.model.Mention
import ac.cord.auxiliary.compose.database.model.NostrEvent
import ac.cord.auxiliary.compose.database.model.Profile
import ac.cord.auxiliary.compose.database.model.QuotedRelation
@@ -37,13 +38,12 @@ data class LocalInReplyToNostrEvent(
)
val profile: Profile?,
// TODO: Figure out if we want to add the root of the reply...
// @Relation(
// entity = Mention::class,
// parentColumn = "id",
// entityColumn = "nostrEventId",
// )
// val mentionedProfiles: List<LocalMention?> = emptyList(),
@Relation(
entity = Mention::class,
parentColumn = "inReplyToNostrEventId",
entityColumn = "nostrEventId",
)
val mentionedProfiles: List<LocalMention?> = emptyList(),
) {
@Composable
fun RenderNotePreview() {
@@ -1,5 +1,6 @@
package ac.cord.auxiliary.compose.database.model.intermdiate
import ac.cord.auxiliary.compose.database.model.Mention
import ac.cord.auxiliary.compose.database.model.NostrEvent
import ac.cord.auxiliary.compose.database.model.Profile
import ac.cord.auxiliary.compose.database.model.QuotedRelation
@@ -36,12 +37,12 @@ data class LocalQuotedNostrEvent(
)
val profile: Profile?,
// @Relation(
// entity = Mention::class,
// parentColumn = "id",
// entityColumn = "nostrEventId",
// )
// val mentionedProfiles: List<LocalMention?> = emptyList(),
@Relation(
entity = Mention::class,
parentColumn = "quotedNostrEventId",
entityColumn = "nostrEventId",
)
val mentionedProfiles: List<LocalMention?> = emptyList(),
) {
@Composable
fun RenderNotePreview() {
@@ -1,5 +1,6 @@
package ac.cord.auxiliary.compose.database.model.intermdiate
import ac.cord.auxiliary.compose.database.model.Mention
import ac.cord.auxiliary.compose.database.model.NostrEvent
import ac.cord.auxiliary.compose.database.model.Profile
import ac.cord.auxiliary.compose.database.model.QuotedRelation
@@ -37,12 +38,12 @@ data class LocalRepostedNostrEvent(
)
val profile: Profile?,
// @Relation(
// entity = Mention::class,
// parentColumn = "id",
// entityColumn = "nostrEventId",
// )
// val mentionedProfiles: List<LocalMention?> = emptyList(),
@Relation(
entity = Mention::class,
parentColumn = "repostedNostrEventId",
entityColumn = "nostrEventId",
)
val mentionedProfiles: List<LocalMention?> = emptyList(),
) {
@Composable
fun RenderNotePreview() {
@@ -24,8 +24,6 @@ import androidx.compose.ui.unit.dp
@Composable
fun QuotedNote(
localQuotedNostrEvent: LocalQuotedNostrEvent? = null,
quotedProfile: Profile? = null,
relayHints: List<String> = emptyList(),
onNoteClick: ((String) -> Unit)? = null,
noteActions: NoteActions? = null
) {
@@ -68,7 +68,7 @@ fun LocalNostrEvent.ListView(
profile = localRepostedNostrEvent.profile,
localQuotedNostrEvent = null,
localInReplyToNostrEvent = null,
mentionedProfiles = emptyList(), // TODO: Add localReposted.mentionedProfiles...
mentionedProfiles = localRepostedNostrEvent.mentionedProfiles,
onNavigateToEvent = onNavigateToEvent
)
} else {