adds a longer crop for npubs so that we can see vanity keys better when they don't have nip05s or statuses
This commit is contained in:
@@ -69,7 +69,7 @@ class User(
|
||||
|
||||
fun pubkeyNpub() = pubkey().toNpub()
|
||||
|
||||
fun pubkeyDisplayHex() = pubkeyNpub().toShortDisplay()
|
||||
fun pubkeyDisplayHex() = pubkeyNpub().toShortDisplay(5)
|
||||
|
||||
fun dmInboxRelayList() = dmRelayListNote.event as? ChatMessageRelayListEvent
|
||||
|
||||
|
||||
+3
-3
@@ -29,9 +29,9 @@ import com.vitorpamplona.quartz.nip01Core.core.toHexKey
|
||||
*
|
||||
* @return Shortened string with ellipsis in the middle, or original if <= 16 chars
|
||||
*/
|
||||
fun String.toShortDisplay(): String {
|
||||
if (length <= 16) return this
|
||||
return replaceRange(8, length - 8, "…")
|
||||
fun String.toShortDisplay(prefixSize: Int = 0): String {
|
||||
if (length <= prefixSize + 16) return this
|
||||
return replaceRange(prefixSize + 8, length - 8, "…")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user