damus

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

commit a9e9f0dc8f5ec13533b08b6ce7e109cf0033b2e3
parent 5edb7df5c42dcbce8b2626df14f113098f1631d0
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 27 Jan 2023 12:16:41 -0800

Hide muted users from global

Changelog-Fixed: Hide muted users from global

Diffstat:
Mdamus/Models/SearchHomeModel.swift | 6+++++-
Mdamus/Views/SearchHomeView.swift | 3+++
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/damus/Models/SearchHomeModel.swift b/damus/Models/SearchHomeModel.swift @@ -30,6 +30,10 @@ class SearchHomeModel: ObservableObject { return filter } + func filter_muted() { + events = events.filter { !should_hide_event(contacts: damus_state.contacts, ev: $0) } + } + func subscribe() { loading = true damus_state.pool.subscribe(sub_id: base_subid, filters: [get_base_filter()], handler: handle_event) @@ -50,7 +54,7 @@ class SearchHomeModel: ObservableObject { guard sub_id == self.base_subid || sub_id == self.profiles_subid else { return } - if ev.is_textlike && ev.should_show_event && !ev.is_reply(nil) { + if ev.is_textlike && !should_hide_event(contacts: damus_state.contacts, ev: ev) && !ev.is_reply(nil) { if seen_pubkey.contains(ev.pubkey) { return } diff --git a/damus/Views/SearchHomeView.swift b/damus/Views/SearchHomeView.swift @@ -87,6 +87,9 @@ struct SearchHomeView: View { .onChange(of: search) { s in print("search change 1") } + .onReceive(handle_notify(.new_mutes)) { _ in + self.model.filter_muted() + } .onAppear { if model.events.isEmpty { model.subscribe()