forked from janek/mostr
1
0
Fork 0

feat: properly submit all events

This commit is contained in:
xeruf 2024-07-18 22:19:08 +03:00
parent 3968e5c1ae
commit 6362b62a86
1 changed files with 7 additions and 2 deletions

View File

@ -71,7 +71,7 @@ async fn main() {
.get_events_of(vec![filter], Option::from(timeout)) .get_events_of(vec![filter], Option::from(timeout))
.map_ok(|res| { .map_ok(|res| {
for event in res { for event in res {
println!("Found {} {:?}", event.content, event.tags) println!("Found {} '{}' {:?}", event.kind, event.content, event.tags)
} }
}) })
.await; .await;
@ -249,9 +249,14 @@ async fn repl() {
} }
println!(); println!();
println!("Submitting created events");
let _ = CLIENT let _ = CLIENT
.batch_event( .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), RelaySendOptions::new().skip_send_confirmation(true),
) )
.await; .await;