From 6362b62a861042c84150a4a81db25cda89f39673 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Thu, 18 Jul 2024 22:19:08 +0300 Subject: [PATCH] feat: properly submit all events --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index dc37ade..81311aa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,7 +71,7 @@ async fn main() { .get_events_of(vec![filter], Option::from(timeout)) .map_ok(|res| { for event in res { - println!("Found {} {:?}", event.content, event.tags) + println!("Found {} '{}' {:?}", event.kind, event.content, event.tags) } }) .await; @@ -249,9 +249,14 @@ async fn repl() { } println!(); + println!("Submitting created events"); let _ = CLIENT .batch_event( - tasks.into_values().map(|t| t.event).collect(), + tasks.into_values().flat_map(|mut t| { + let mut ev = t.props; + ev.push(t.event); + ev + }).collect(), RelaySendOptions::new().skip_send_confirmation(true), ) .await;