damus

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

commit 79ea4da2d28ddc9ca9f8e5bbee9543c16a4b9cfb
parent 4781795187a41f4a7f5053ba51bbf6571c7edcfb
Author: Joel Klabo <joelklabo@gmail.com>
Date:   Wed, 28 Dec 2022 21:33:39 -0800

Don't Badge DMs if Sent By You

Closes: #176
Changelog-Fixed: Don't badge DMs if sent by you

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

diff --git a/damus/Models/HomeModel.swift b/damus/Models/HomeModel.swift @@ -338,12 +338,14 @@ class HomeModel: ObservableObject { return m[kind] } - func handle_last_event(ev: NostrEvent, timeline: Timeline) { + func handle_last_event(ev: NostrEvent, timeline: Timeline, shouldNotify: Bool = true) { let last_ev = get_last_event(timeline) if last_ev == nil || last_ev!.created_at < ev.created_at { save_last_event(ev, timeline: timeline) - new_events = NewEventsBits(prev: new_events, setting: timeline) + if shouldNotify { + new_events = NewEventsBits(prev: new_events, setting: timeline) + } } } @@ -415,7 +417,7 @@ class HomeModel: ObservableObject { } if inserted { - handle_last_event(ev: ev, timeline: .dms) + handle_last_event(ev: ev, timeline: .dms, shouldNotify: !ours) dms.dms = dms.dms.sorted { a, b in if a.1.events.count > 0 && b.1.events.count > 0 {