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:
Vitor Pamplona
2026-02-07 10:17:37 -05:00
parent bab881e75d
commit 823624f8f2
2 changed files with 4 additions and 4 deletions
@@ -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
@@ -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, "")
}
/**