fix "Replying to..." issues and improve related tests

This commit is contained in:
Bryan Montz authored and William Casarin committed 2023-03-14 11:44:40 -06:00
1 parent dd511c3061
commit cabe584938
3 files changed
+46 -49

No files matched your search

+7 -2
View File
@@ -144,8 +144,13 @@ struct Profile: Codable {
if pubkey == "anon" {
return "Anonymous"
}
let pk = bech32_nopre_pubkey(pubkey) ?? pubkey
return profile?.name ?? abbrev_pubkey(pk)
if let name = profile?.name, !name.isEmpty {
return name
} else {
let pk = bech32_nopre_pubkey(pubkey) ?? pubkey
return abbrev_pubkey(pk)
}
}
}