commit 127f1e07e340b6ace1419d2e68844b44c94a6bf0 parent cc190c3618831ef8c73e3e4291301388adc2543d Author: William Casarin <jb55@jb55.com> Date: Mon, 3 Apr 2023 09:54:56 -0700 Broadcast events you are replying to Changelog-Changed: Broadcast events you are replying to Diffstat:
M | damus/ContentView.swift | | | 11 | ++++++++++- |
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/damus/ContentView.swift b/damus/ContentView.swift @@ -454,7 +454,16 @@ struct ContentView: View { //let to_relays = tup.1 print("post \(post.content)") let new_ev = post_to_event(post: post, privkey: privkey, pubkey: pubkey) - self.damus_state?.postbox.send(new_ev) + guard let ds = self.damus_state else { + return + } + ds.postbox.send(new_ev) + for eref in new_ev.referenced_ids.prefix(3) { + // also broadcast at most 3 referenced events + if let ev = ds.events.lookup(eref.ref_id) { + ds.postbox.send(ev) + } + } case .cancel: active_sheet = nil print("post cancelled")