Send message to all users in the room
(&self, room: &str, message: &str, skip_id: u64)
| 91 | impl ChatServer { |
| 92 | /// Send message to all users in the room |
| 93 | fn send_message(&self, room: &str, message: &str, skip_id: u64) { |
| 94 | if let Some(sessions) = self.rooms.get(room) { |
| 95 | for id in sessions { |
| 96 | if *id != skip_id { |
| 97 | if let Some(addr) = self.sessions.get(id) { |
| 98 | addr.do_send(Message(message.to_owned())); |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | /// Make actor from `ChatServer` |