Leave room when Room
entity is dropped
This commit is contained in:
parent
573086eed2
commit
e55e7e4844
6 changed files with 89 additions and 20 deletions
|
@ -153,6 +153,7 @@ impl Server {
|
|||
.add_request_handler(Server::ping)
|
||||
.add_request_handler(Server::create_room)
|
||||
.add_request_handler(Server::join_room)
|
||||
.add_message_handler(Server::leave_room)
|
||||
.add_request_handler(Server::call)
|
||||
.add_message_handler(Server::decline_call)
|
||||
.add_request_handler(Server::register_project)
|
||||
|
@ -627,6 +628,14 @@ impl Server {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
async fn leave_room(self: Arc<Server>, message: TypedEnvelope<proto::LeaveRoom>) -> Result<()> {
|
||||
let room_id = message.payload.id;
|
||||
let mut store = self.store().await;
|
||||
let room = store.leave_room(room_id, message.sender_id)?;
|
||||
self.room_updated(room);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn call(
|
||||
self: Arc<Server>,
|
||||
request: TypedEnvelope<proto::Call>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue