Send message to all other users in current room. `conn` is used to find current room and prevent messages sent by a connection also being received by it.
(&self, conn: ConnId, msg: impl Into<Msg>)
| 107 | /// `conn` is used to find current room and prevent messages sent by a connection also being |
| 108 | /// received by it. |
| 109 | async fn send_message(&self, conn: ConnId, msg: impl Into<Msg>) { |
| 110 | if let Some(room) = self |
| 111 | .rooms |
| 112 | .iter() |
| 113 | .find_map(|(room, participants)| participants.contains(&conn).then_some(room)) |
| 114 | { |
| 115 | self.send_system_message(room, conn, msg).await; |
| 116 | }; |
| 117 | } |
| 118 | |
| 119 | /// Register new session and assign unique ID to this session |
| 120 | async fn connect(&mut self, tx: mpsc::UnboundedSender<Msg>) -> ConnId { |
no test coverage detected