From 8e8fb7c45e8088843b71cb55fede723b2f9c7ff2 Mon Sep 17 00:00:00 2001 From: stale Date: Sun, 29 May 2022 05:34:16 -0300 Subject: *really* basic public lobby --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 2b5f9b1..2f7d52c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,7 +39,16 @@ async fn tokio_main(conf: Config) -> Result<(), Box> { let style = path!("s.css").and(fs::file(conf.stylesheet.clone())); let code = path!("c.js").and(fs::file(conf.client_code.clone())); let font = path!("f.ttf").map(|| FONT_FILE); - let listing = path!("rlist").map(|| "placeholder'em"); + let listing = { + let pubs = public_rooms.clone(); + path!("rlist").and_then(move || { + let pubs = pubs.clone(); + async move { + Ok::<_,std::convert::Infallible>( + reply::json(&pubs.read().await.as_slice()) + ) + }}) + }; let rform_recv = { let rooms = rooms.clone(); let pubs = public_rooms.clone(); -- cgit v1.2.3