damus

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

commit 66fd1dd444bc1ee5066eb76d6c2d45e9ba02fa71
parent b5c384da4380ce126123fec338b172b87f4d14a9
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 25 Jan 2024 12:10:15 -0800

Revert "mute: receiving New Mute List Type"

This reverts commit 2861ee2c12e42d7d1423061ff0a476d4f14e8c6c.

Diffstat:
Mdamus/Models/HomeModel.swift | 35++++++++---------------------------
1 file changed, 8 insertions(+), 27 deletions(-)

diff --git a/damus/Models/HomeModel.swift b/damus/Models/HomeModel.swift @@ -158,9 +158,10 @@ class HomeModel { // profile metadata processing is handled by nostrdb break case .list_deprecated: - handle_old_list_event(ev) + handle_list_event(ev) case .mute_list: - handle_mute_list_event(ev) + // @TODO: this will be implemented in a future patch + break case .boost: handle_boost_event(sub_id: sub_id, ev) case .like: @@ -463,13 +464,10 @@ class HomeModel { var our_contacts_filter = NostrFilter(kinds: [.contacts, .metadata]) our_contacts_filter.authors = [damus_state.pubkey] - var our_old_blocklist_filter = NostrFilter(kinds: [.list_deprecated]) - our_old_blocklist_filter.parameter = ["mute"] - our_old_blocklist_filter.authors = [damus_state.pubkey] - - var our_blocklist_filter = NostrFilter(kinds: [.mute_list]) + var our_blocklist_filter = NostrFilter(kinds: [.list_deprecated]) + our_blocklist_filter.parameter = ["mute"] our_blocklist_filter.authors = [damus_state.pubkey] - + var dms_filter = NostrFilter(kinds: [.dm]) var our_dms_filter = NostrFilter(kinds: [.dm]) @@ -493,7 +491,7 @@ class HomeModel { notifications_filter.limit = 500 var notifications_filters = [notifications_filter] - var contacts_filters = [contacts_filter, our_contacts_filter, our_blocklist_filter, our_old_blocklist_filter] + var contacts_filters = [contacts_filter, our_contacts_filter, our_blocklist_filter] var dms_filters = [dms_filter, our_dms_filter] let last_of_kind = get_last_of_kind(relay_id: relay_id) @@ -562,29 +560,12 @@ class HomeModel { pool.send(.subscribe(sub), to: relay_ids) } - func handle_mute_list_event(_ ev: NostrEvent) { - // we only care about our mutelist - guard ev.pubkey == damus_state.pubkey else { - return - } - - // we only care about the most recent mutelist - if let mutelist = damus_state.contacts.mutelist { - if ev.created_at <= mutelist.created_at { - return - } - } - - damus_state.contacts.set_mutelist(ev) - } - - func handle_old_list_event(_ ev: NostrEvent) { + func handle_list_event(_ ev: NostrEvent) { // we only care about our lists guard ev.pubkey == damus_state.pubkey else { return } - // we only care about the most recent mutelist if let mutelist = damus_state.contacts.mutelist { if ev.created_at <= mutelist.created_at { return