Merge branch 'vitorpamplona:main' into profiles-list-management

This commit is contained in:
KotlinGeekDev
2025-08-28 15:08:48 +00:00
committed by GitHub
8 changed files with 24 additions and 12 deletions

View File

@@ -117,7 +117,7 @@ class MetadataEvent(
lnURL?.let { addIfNotBlank(currentMetadata, Lud06Tag.TAG_NAME, it.trim()) }
return eventTemplate(KIND, currentMetadata.toString(), createdAt) {
alt("User profile for ${currentMetadata.get("name").asText() ?: "Anonymous"}")
alt("User profile for ${currentMetadata.get("name")?.asText() ?: "Anonymous"}")
// For https://github.com/nostr-protocol/nips/pull/1770
currentMetadata.get(NameTag.TAG_NAME)?.asText()?.let { name(it) }
@@ -132,7 +132,7 @@ class MetadataEvent(
currentMetadata.get(Lud06Tag.TAG_NAME)?.asText()?.let { lud06(it) }
twitter?.let { twitterClaim(it) }
?: mastodon?.let { mastodonClaim(it) }
mastodon?.let { mastodonClaim(it) }
github?.let { githubClaim(it) }
initializer()

View File

@@ -37,9 +37,9 @@ class PayInvoiceSuccessResponse(
val result: PayInvoiceResultParams? = null,
) : Response("pay_invoice") {
class PayInvoiceResultParams(
val preimage: String,
val preimage: String? = null,
) {
fun countMemory(): Long = pointerSizeInBytes + preimage.bytesUsedInMemory()
fun countMemory(): Long = pointerSizeInBytes + (preimage?.bytesUsedInMemory() ?: 0)
}
override fun countMemory(): Long = pointerSizeInBytes + (result?.countMemory() ?: 0)
@@ -49,8 +49,8 @@ class PayInvoiceErrorResponse(
val error: PayInvoiceErrorParams? = null,
) : Response("pay_invoice") {
class PayInvoiceErrorParams(
val code: ErrorType?,
val message: String?,
val code: ErrorType? = null,
val message: String? = null,
) {
fun countMemory(): Long = pointerSizeInBytes + pointerSizeInBytes + (message?.bytesUsedInMemory() ?: 0)
}