DVM: adapt nip89 naming, show picture then image (legacy)

This commit is contained in:
Believethehype 2024-12-02 19:55:02 +01:00
parent bd2005ec6e
commit e0e898d4b1
2 changed files with 7 additions and 7 deletions

View File

@ -646,14 +646,14 @@ fun observeAppDefinition(appDefinitionNote: Note): DVMCard {
DVMCard(
name = noteEvent?.appMetaData()?.name ?: "",
description = noteEvent?.appMetaData()?.about ?: "",
cover = noteEvent?.appMetaData()?.image?.ifBlank { null },
cover = noteEvent?.appMetaData()?.profilePicture()?.ifBlank { null },
)
}.distinctUntilChanged()
.observeAsState(
DVMCard(
name = noteEvent.appMetaData()?.name ?: "",
description = noteEvent.appMetaData()?.about ?: "",
cover = noteEvent.appMetaData()?.image?.ifBlank { null },
cover = noteEvent.appMetaData()?.profilePicture()?.ifBlank { null },
),
)

View File

@ -45,8 +45,8 @@ class AppMetadata {
var website: String? = null
var about: String? = null
var subscription: Boolean? = false
var cashuAccepted: Boolean? = false
var encryptionSupported: Boolean? = false
var acceptsNutZaps: Boolean? = false
var supportsEncryption: Boolean? = false
var personalized: Boolean? = false
var amount: String? = null
@ -71,8 +71,8 @@ class AppMetadata {
(website?.bytesUsedInMemory() ?: 0L) +
(about?.bytesUsedInMemory() ?: 0L) +
(subscription?.bytesUsedInMemory() ?: 0L) +
(cashuAccepted?.bytesUsedInMemory() ?: 0L) +
(encryptionSupported?.bytesUsedInMemory() ?: 0L) +
(acceptsNutZaps?.bytesUsedInMemory() ?: 0L) +
(supportsEncryption?.bytesUsedInMemory() ?: 0L) +
(personalized?.bytesUsedInMemory() ?: 0L) + // A Boolean has 8 bytes of header, plus 1 byte of payload, for a total of 9 bytes of information. The JVM then rounds it up to the next multiple of 8. so the one instance of java.lang.Boolean takes up 16 bytes of memory.
(amount?.bytesUsedInMemory() ?: 0L) +
(nip05?.bytesUsedInMemory() ?: 0L) +
@ -95,7 +95,7 @@ class AppMetadata {
fun nip05(): String? = nip05
fun profilePicture(): String? = picture
fun profilePicture(): String? = picture ?: image
fun cleanBlankNames() {
if (picture?.isNotEmpty() == true) picture = picture?.trim()