Remove even more stupid code
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -43,7 +43,7 @@ data class LocalQuotedNostrEvent(
|
||||
parentColumn = "quotedNostrEventId",
|
||||
entityColumn = "mentioningNostrEventId",
|
||||
)
|
||||
val mentionedProfiles: List<LocalMention?>? = emptyList(),
|
||||
val mentionedProfiles: List<LocalMention> = emptyList(),
|
||||
) {
|
||||
@Composable
|
||||
fun RenderNotePreview() {
|
||||
|
||||
@@ -43,7 +43,7 @@ data class LocalRepostedNostrEvent(
|
||||
parentColumn = "repostedNostrEventId",
|
||||
entityColumn = "mentioningNostrEventId",
|
||||
)
|
||||
val mentionedProfiles: List<LocalMention>? = emptyList(),
|
||||
val mentionedProfiles: List<LocalMention> = emptyList(),
|
||||
) {
|
||||
@Composable
|
||||
fun RenderNotePreview() {
|
||||
|
||||
@@ -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)}"
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user