From 3a1694ac9ab30afad26639fd7608999a6bbdf456 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 3 Jul 2023 08:36:33 -0400 Subject: [PATCH] Renames Hex Check method for better understanding. --- .../com/vitorpamplona/amethyst/model/LocalCache.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt b/app/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt index cf474f7f5..e9343fdb8 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt @@ -35,7 +35,7 @@ object LocalCache { fun checkGetOrCreateUser(key: String): User? { checkNotInMainThread() - if (isValidHexNpub(key)) { + if (isValidHex(key)) { return getOrCreateUser(key) } return null @@ -69,7 +69,7 @@ object LocalCache { if (ATag.isATag(key)) { return checkGetOrCreateAddressableNote(key) } - if (isValidHexNpub(key)) { + if (isValidHex(key)) { val note = getOrCreateNote(key) val noteEvent = note.event if (noteEvent is AddressableEvent) { @@ -94,7 +94,7 @@ object LocalCache { fun checkGetOrCreateChannel(key: String): Channel? { checkNotInMainThread() - if (isValidHexNpub(key)) { + if (isValidHex(key)) { return getOrCreateChannel(key) { PublicChatChannel(key) } @@ -108,7 +108,7 @@ object LocalCache { return null } - private fun isValidHexNpub(key: String): Boolean { + private fun isValidHex(key: String): Boolean { if (key.isBlank()) return false if (key.contains(":")) return false @@ -798,7 +798,7 @@ object LocalCache { note.loadEvent(event, author, replyTo) - // Log.d("CM", "New Note (${notes.size},${users.size}) ${note.author?.toBestDisplayName()} ${note.event?.content()} ${formattedDateTime(event.createdAt)}") + Log.d("CM", "New Chat Note (${note.author?.toBestDisplayName()} ${note.event?.content()} ${formattedDateTime(event.createdAt)}") // Counts the replies replyTo.forEach {