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

This commit is contained in:
Bryan Montz
2023-03-14 12:08:18 -05:00
committed by William Casarin
parent dd511c3061
commit cabe584938
3 changed files with 46 additions and 49 deletions

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