mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-26 17:52:29 +01:00
Removes warnings from the quartz library.
This commit is contained in:
parent
238e577b93
commit
7468352795
@ -30,7 +30,7 @@ class Lud06 {
|
||||
|
||||
fun toLud16(str: String): String? {
|
||||
return try {
|
||||
val url = toLnUrlp(str)
|
||||
val url = toLnUrlp(str) ?: return null
|
||||
|
||||
val matcher = LNURLP_PATTERN.matcher(url)
|
||||
if (matcher.find()) {
|
||||
|
@ -94,7 +94,9 @@ object Nip19Bech32 {
|
||||
val key = matcher.group(3) // bech32
|
||||
val additionalChars = matcher.group(4) // additional chars
|
||||
|
||||
return parseComponents(type!!, key, additionalChars)
|
||||
if (type == null) return null
|
||||
|
||||
return parseComponents(type, key, additionalChars)
|
||||
} catch (e: Throwable) {
|
||||
Log.e("NIP19 Parser", "Issue trying to Decode NIP19 $uri: ${e.message}", e)
|
||||
}
|
||||
|
@ -105,14 +105,16 @@ open class BaseTextNoteEvent(
|
||||
val additionalChars = matcher2.group(4) // additional chars
|
||||
|
||||
try {
|
||||
val parsed = Nip19Bech32.parseComponents(type, key, additionalChars)?.entity
|
||||
if (type != null) {
|
||||
val parsed = Nip19Bech32.parseComponents(type, key, additionalChars)?.entity
|
||||
|
||||
if (parsed != null) {
|
||||
if (parsed is Nip19Bech32.NProfile) {
|
||||
returningList.add(parsed.hex)
|
||||
}
|
||||
if (parsed is Nip19Bech32.NPub) {
|
||||
returningList.add(parsed.hex)
|
||||
if (parsed != null) {
|
||||
if (parsed is Nip19Bech32.NProfile) {
|
||||
returningList.add(parsed.hex)
|
||||
}
|
||||
if (parsed is Nip19Bech32.NPub) {
|
||||
returningList.add(parsed.hex)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
@ -151,14 +153,16 @@ open class BaseTextNoteEvent(
|
||||
val key = matcher2.group(3) // bech32
|
||||
val additionalChars = matcher2.group(4) // additional chars
|
||||
|
||||
val parsed = Nip19Bech32.parseComponents(type, key, additionalChars)?.entity
|
||||
if (type != null) {
|
||||
val parsed = Nip19Bech32.parseComponents(type, key, additionalChars)?.entity
|
||||
|
||||
if (parsed != null) {
|
||||
when (parsed) {
|
||||
is Nip19Bech32.NEvent -> citations.add(parsed.hex)
|
||||
is Nip19Bech32.NAddress -> citations.add(parsed.atag)
|
||||
is Nip19Bech32.Note -> citations.add(parsed.hex)
|
||||
is Nip19Bech32.NEmbed -> citations.add(parsed.event.id)
|
||||
if (parsed != null) {
|
||||
when (parsed) {
|
||||
is Nip19Bech32.NEvent -> citations.add(parsed.hex)
|
||||
is Nip19Bech32.NAddress -> citations.add(parsed.atag)
|
||||
is Nip19Bech32.Note -> citations.add(parsed.hex)
|
||||
is Nip19Bech32.NEmbed -> citations.add(parsed.event.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ interface EventInterface {
|
||||
|
||||
fun isTaggedUser(idHex: String): Boolean
|
||||
|
||||
fun isTaggedUsers(idHex: Set<String>): Boolean
|
||||
fun isTaggedUsers(idHexes: Set<String>): Boolean
|
||||
|
||||
fun isTaggedEvent(idHex: String): Boolean
|
||||
|
||||
|
@ -60,7 +60,7 @@ class GitPatchEvent(
|
||||
fun commitPGPSig() = tags.firstOrNull { it.size > 1 && it[0] == "commit-pgp-sig" }?.get(1)
|
||||
|
||||
fun committer() =
|
||||
tags.filter { it.size > 1 && it[0] == "committer" }?.mapNotNull {
|
||||
tags.filter { it.size > 1 && it[0] == "committer" }.mapNotNull {
|
||||
Committer(it.getOrNull(1), it.getOrNull(2), it.getOrNull(3), it.getOrNull(4))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user