mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 18:26:35 +02:00
DVM: adapt nip89 naming, show picture then image (legacy)
This commit is contained in:
@@ -646,14 +646,14 @@ fun observeAppDefinition(appDefinitionNote: Note): DVMCard {
|
|||||||
DVMCard(
|
DVMCard(
|
||||||
name = noteEvent?.appMetaData()?.name ?: "",
|
name = noteEvent?.appMetaData()?.name ?: "",
|
||||||
description = noteEvent?.appMetaData()?.about ?: "",
|
description = noteEvent?.appMetaData()?.about ?: "",
|
||||||
cover = noteEvent?.appMetaData()?.image?.ifBlank { null },
|
cover = noteEvent?.appMetaData()?.profilePicture()?.ifBlank { null },
|
||||||
)
|
)
|
||||||
}.distinctUntilChanged()
|
}.distinctUntilChanged()
|
||||||
.observeAsState(
|
.observeAsState(
|
||||||
DVMCard(
|
DVMCard(
|
||||||
name = noteEvent.appMetaData()?.name ?: "",
|
name = noteEvent.appMetaData()?.name ?: "",
|
||||||
description = noteEvent.appMetaData()?.about ?: "",
|
description = noteEvent.appMetaData()?.about ?: "",
|
||||||
cover = noteEvent.appMetaData()?.image?.ifBlank { null },
|
cover = noteEvent.appMetaData()?.profilePicture()?.ifBlank { null },
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -45,8 +45,8 @@ class AppMetadata {
|
|||||||
var website: String? = null
|
var website: String? = null
|
||||||
var about: String? = null
|
var about: String? = null
|
||||||
var subscription: Boolean? = false
|
var subscription: Boolean? = false
|
||||||
var cashuAccepted: Boolean? = false
|
var acceptsNutZaps: Boolean? = false
|
||||||
var encryptionSupported: Boolean? = false
|
var supportsEncryption: Boolean? = false
|
||||||
var personalized: Boolean? = false
|
var personalized: Boolean? = false
|
||||||
var amount: String? = null
|
var amount: String? = null
|
||||||
|
|
||||||
@@ -71,8 +71,8 @@ class AppMetadata {
|
|||||||
(website?.bytesUsedInMemory() ?: 0L) +
|
(website?.bytesUsedInMemory() ?: 0L) +
|
||||||
(about?.bytesUsedInMemory() ?: 0L) +
|
(about?.bytesUsedInMemory() ?: 0L) +
|
||||||
(subscription?.bytesUsedInMemory() ?: 0L) +
|
(subscription?.bytesUsedInMemory() ?: 0L) +
|
||||||
(cashuAccepted?.bytesUsedInMemory() ?: 0L) +
|
(acceptsNutZaps?.bytesUsedInMemory() ?: 0L) +
|
||||||
(encryptionSupported?.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.
|
(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) +
|
(amount?.bytesUsedInMemory() ?: 0L) +
|
||||||
(nip05?.bytesUsedInMemory() ?: 0L) +
|
(nip05?.bytesUsedInMemory() ?: 0L) +
|
||||||
@@ -95,7 +95,7 @@ class AppMetadata {
|
|||||||
|
|
||||||
fun nip05(): String? = nip05
|
fun nip05(): String? = nip05
|
||||||
|
|
||||||
fun profilePicture(): String? = picture
|
fun profilePicture(): String? = picture ?: image
|
||||||
|
|
||||||
fun cleanBlankNames() {
|
fun cleanBlankNames() {
|
||||||
if (picture?.isNotEmpty() == true) picture = picture?.trim()
|
if (picture?.isNotEmpty() == true) picture = picture?.trim()
|
||||||
|
Reference in New Issue
Block a user