Removes warnings from the quartz library.

This commit is contained in:
Vitor Pamplona 2024-03-01 10:40:12 -05:00
parent 238e577b93
commit 7468352795
5 changed files with 24 additions and 18 deletions

View File

@ -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()) {

View File

@ -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)
}

View File

@ -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)
}
}
}
}

View File

@ -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

View File

@ -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))
}