Moves lud06 to lud16 mapping to Quartz
This commit is contained in:
@@ -157,20 +157,9 @@ class User(
|
|||||||
metaEvent: MetadataEvent,
|
metaEvent: MetadataEvent,
|
||||||
) {
|
) {
|
||||||
newUserInfo.cleanBlankNames()
|
newUserInfo.cleanBlankNames()
|
||||||
|
newUserInfo.convertLud06toLud16IfNeeded()
|
||||||
|
|
||||||
// converts lud06 to lud16
|
metadata().newMetadata(newUserInfo, metaEvent)
|
||||||
if (newUserInfo.lud16.isNullOrBlank()) {
|
|
||||||
newUserInfo.lud06?.let {
|
|
||||||
if (it.lowercase().startsWith("lnurl")) {
|
|
||||||
newUserInfo.lud16 = Lud06().toLud16(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val metadata = metadata()
|
|
||||||
|
|
||||||
metadata.newMetadata(newUserInfo, metaEvent)
|
|
||||||
|
|
||||||
// doesn't create Nip05 unless needed.
|
// doesn't create Nip05 unless needed.
|
||||||
nip05StateOrNull()?.newMetadata(newUserInfo.nip05, metaEvent.pubKey)
|
nip05StateOrNull()?.newMetadata(newUserInfo.nip05, metaEvent.pubKey)
|
||||||
}
|
}
|
||||||
|
|||||||
+11
@@ -21,6 +21,7 @@
|
|||||||
package com.vitorpamplona.quartz.nip01Core.metadata
|
package com.vitorpamplona.quartz.nip01Core.metadata
|
||||||
|
|
||||||
import androidx.compose.runtime.Stable
|
import androidx.compose.runtime.Stable
|
||||||
|
import com.vitorpamplona.quartz.lightning.Lud06
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -102,4 +103,14 @@ class UserMetadata {
|
|||||||
if (domain?.isBlank() == true) domain = null
|
if (domain?.isBlank() == true) domain = null
|
||||||
if (pronouns?.isBlank() == true) pronouns = null
|
if (pronouns?.isBlank() == true) pronouns = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun convertLud06toLud16IfNeeded() {
|
||||||
|
if (lud16.isNullOrBlank()) {
|
||||||
|
lud06?.let {
|
||||||
|
if (it.lowercase().startsWith("lnurl")) {
|
||||||
|
lud16 = Lud06().toLud16(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user