Browse Source
Merge branch 'master' into rocket-0.4
pull/284/head
Daniel García
6 years ago
No known key found for this signature in database
GPG Key ID: FC8A7D14C3CD543A
1 changed files with
4 additions and
6 deletions
-
src/api/notifications.rs
|
|
@ -219,7 +219,6 @@ impl Factory for WSFactory { |
|
|
|
type Handler = WSHandler; |
|
|
|
|
|
|
|
fn connection_made(&mut self, out: Sender) -> Self::Handler { |
|
|
|
println!("WS: Connection made"); |
|
|
|
WSHandler { |
|
|
|
out, |
|
|
|
user_uuid: None, |
|
|
@ -228,14 +227,13 @@ impl Factory for WSFactory { |
|
|
|
} |
|
|
|
|
|
|
|
fn connection_lost(&mut self, handler: Self::Handler) { |
|
|
|
println!("WS: Connection lost"); |
|
|
|
|
|
|
|
// 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) { |
|
|
|
user_conn.remove_item(&handler.out); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#[derive(Clone)] |
|
|
|