0
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden synced 2024-06-28 08:48:19 +02:00

Merge branch 'master' into rocket-0.4

This commit is contained in:
Daniel García 2018-11-21 15:35:34 +01:00
commit f1acc1e05a
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A

View file

@ -219,7 +219,6 @@ impl Factory for WSFactory {
type Handler = WSHandler; type Handler = WSHandler;
fn connection_made(&mut self, out: Sender) -> Self::Handler { fn connection_made(&mut self, out: Sender) -> Self::Handler {
println!("WS: Connection made");
WSHandler { WSHandler {
out, out,
user_uuid: None, user_uuid: None,
@ -228,14 +227,13 @@ impl Factory for WSFactory {
} }
fn connection_lost(&mut self, handler: Self::Handler) { fn connection_lost(&mut self, handler: Self::Handler) {
println!("WS: Connection lost");
// Remove handler // Remove handler
let user_uuid = &handler.user_uuid.unwrap(); if let Some(user_uuid) = &handler.user_uuid {
if let Some(mut user_conn) = self.users.map.get_mut(user_uuid) { if let Some(mut user_conn) = self.users.map.get_mut(user_uuid) {
user_conn.remove_item(&handler.out); user_conn.remove_item(&handler.out);
} }
} }
}
} }
#[derive(Clone)] #[derive(Clone)]