stuff
This commit is contained in:
parent
98fc180016
commit
b1187f118e
|
@ -39,6 +39,16 @@ impl ChatRoom {
|
||||||
self.user_registry.get_unique_user_ids()
|
self.user_registry.get_unique_user_ids()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn store_message(&self) {
|
||||||
|
let broadcast_tx = self.broadcast_tx.clone();
|
||||||
|
let mut broadcast_rx = broadcast_tx.subscribe();
|
||||||
|
|
||||||
|
let message_data = broadcast_rx.recv().await.unwrap();
|
||||||
|
|
||||||
|
println!("{:?}", message_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Add a participant to the room and broadcast that they joined
|
/// Add a participant to the room and broadcast that they joined
|
||||||
///
|
///
|
||||||
/// # Returns
|
/// # Returns
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use comms::event;
|
use comms::event;
|
||||||
use tokio::sync::broadcast;
|
use tokio::sync::broadcast;
|
||||||
|
use super::chat_room;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct SessionAndUserId {
|
pub struct SessionAndUserId {
|
||||||
|
@ -59,6 +60,8 @@ impl UserSessionHandle {
|
||||||
))
|
))
|
||||||
.context("could not write to the broadcast channel")?;
|
.context("could not write to the broadcast channel")?;
|
||||||
|
|
||||||
|
chat_room::store_message();
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue