damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 06c2741bf4637c7697bc03aef0196824c481f6c4
parent 721bb9abf510378178cabb3c4d142f5e116fccd4
Author: randymcmillan <randy.lee.mcmillan@gmail.com>
Date:   Fri, 29 Jul 2022 16:26:43 -0400

Always make hashtag filters lowercased

Changelog-Fixed: Fix case sensitivity when searching hashtags
Closes: #737

Diffstat:
Mdamus/Nostr/NostrFilter.swift | 2+-
Mdamus/Nostr/NostrLink.swift | 2+-
Mdamus/Views/SearchHomeView.swift | 3---
3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/damus/Nostr/NostrFilter.swift b/damus/Nostr/NostrFilter.swift @@ -37,7 +37,7 @@ struct NostrFilter: Codable, Equatable { } public static func filter_hashtag(_ htags: [String]) -> NostrFilter { - return NostrFilter(ids: nil, kinds: nil, referenced_ids: nil, pubkeys: nil, since: nil, until: nil, authors: nil, hashtag: htags) + return NostrFilter(ids: nil, kinds: nil, referenced_ids: nil, pubkeys: nil, since: nil, until: nil, authors: nil, hashtag: htags.map { $0.lowercased() }) } public static var filter_text: NostrFilter { diff --git a/damus/Nostr/NostrLink.swift b/damus/Nostr/NostrLink.swift @@ -137,7 +137,7 @@ func decode_nostr_uri(_ s: String) -> NostrLink? { } if tag_is_hashtag(parts) { - return .filter(NostrFilter.filter_hashtag([parts[1].lowercased()])) + return .filter(NostrFilter.filter_hashtag([parts[1]])) } if let rid = tag_to_refid(parts) { diff --git a/damus/Views/SearchHomeView.swift b/damus/Views/SearchHomeView.swift @@ -83,9 +83,6 @@ struct SearchHomeView: View { } .background(colorScheme == .dark ? Color.black : Color.white) } - .onChange(of: search) { s in - print("search change 1") - } .onReceive(handle_notify(.new_mutes)) { _ in self.model.filter_muted() }