commit 4d3a3184b49a2ece27a52fcf12d14af26f320647
parent 71b1a9d14ff89a5f1257a70738c5e13dabdd8c5e
Author: William Casarin <jb55@jb55.com>
Date: Wed, 4 Jan 2023 02:01:57 -0800
nip05: make hosts searchable
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/damus/Views/SearchResultsView.swift b/damus/Views/SearchResultsView.swift
@@ -118,11 +118,14 @@ struct SearchResultsView: View {
let pk = els.element.key
let prof = els.element.value.profile
let lowname = prof.name.map { $0.lowercased() }
+ let lownip05 = damus_state.profiles.is_validated(pk).map { $0.host.lowercased() }
let lowdisp = prof.display_name.map { $0.lowercased() }
let ok = new.count == 1 ?
((lowname?.starts(with: new) ?? false) ||
+ (lownip05?.starts(with: new) ?? false) ||
(lowdisp?.starts(with: new) ?? false)) : (pk.starts(with: new) || String(new.dropFirst()) == pk
|| lowname?.contains(new) ?? false
+ || lownip05?.contains(new) ?? false
|| lowdisp?.contains(new) ?? false)
if ok {
acc.append((pk, prof))