Skip to content

Commit

Permalink
nostrdb: fix profiles not updating
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jb55 committed Sep 25, 2023
1 parent f591ad2 commit 476f525
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion damus/Nostr/RelayPool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 476f525

Please sign in to comment.