mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-23 19:15:10 +02:00
Moving aTag check to the ATag class
This commit is contained in:
@@ -77,7 +77,7 @@ object LocalCache {
|
||||
}
|
||||
|
||||
fun checkGetOrCreateNote(key: String): Note? {
|
||||
if (key.startsWith("naddr1") || key.contains(":")) {
|
||||
if (ATag.isATag(key)) {
|
||||
return checkGetOrCreateAddressableNote(key)
|
||||
}
|
||||
return try {
|
||||
|
@@ -34,6 +34,10 @@ data class ATag(val kind: Int, val pubKeyHex: String, val dTag: String, val rela
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun isATag(key: String): Boolean {
|
||||
return key.startsWith("naddr1") || key.contains(":")
|
||||
}
|
||||
|
||||
fun parse(address: String, relay: String?): ATag? {
|
||||
return if (address.startsWith("naddr") || address.startsWith("nostr:naddr"))
|
||||
parseNAddr(address)
|
||||
|
Reference in New Issue
Block a user