damus

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

commit 476f52562a70c2615ad084640dd1a0ba5c4c12e3
parent f591ad2dff192f1a90066c707d2c8260df138bf0
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 24 Sep 2023 17:07:09 -0700

nostrdb: fix profiles not updating

Send relay pool events to nostrdb as well

Whenever we send events to relays, make sure we send them to nostrdb
at the same time.

Changelog-Fixed: Fix profile not updating

Diffstat:
Mdamus/Nostr/RelayPool.swift | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/damus/Nostr/RelayPool.swift b/damus/Nostr/RelayPool.swift @@ -212,9 +212,19 @@ class RelayPool { print("queueing request for \(relay)") request_queue.append(QueuedRequest(req: r, relay: relay, skip_ephemeral: skip_ephemeral)) } - + func send_raw(_ req: NostrRequestType, to: [String]? = nil, skip_ephemeral: Bool = true) { let relays = to.map{ get_relays($0) } ?? self.relays + + // send to local relay (nostrdb) + switch req { + case .typical(let r): + if let rstr = make_nostr_req(r) { + ndb.process_client_event(rstr) + } + case .custom(let string): + ndb.process_client_event(string) + } for relay in relays { if req.is_read && !(relay.descriptor.info.read ?? true) {