equal
deleted
inserted
replaced
70 response.add(Bye("User quit".to_string()).send_self()); |
70 response.add(Bye("User quit".to_string()).send_self()); |
71 LoginResult::Exit |
71 LoginResult::Exit |
72 } |
72 } |
73 HWProtocolMessage::Nick(nick) => { |
73 HWProtocolMessage::Nick(nick) => { |
74 let client = &mut server.anteroom.clients[client_id]; |
74 let client = &mut server.anteroom.clients[client_id]; |
75 debug!("{} {}", nick, is_name_illegal(&nick)); |
75 |
76 if client.nick.is_some() { |
76 if client.nick.is_some() { |
77 response.add(Error("Nickname already provided.".to_string()).send_self()); |
77 response.add(Error("Nickname already provided.".to_string()).send_self()); |
78 LoginResult::Unchanged |
78 LoginResult::Unchanged |
79 } else if is_name_illegal(&nick) { |
79 } else if is_name_illegal(&nick) { |
80 response.add(Bye("Illegal nickname! Nicknames must be between 1-40 characters long, must not have a trailing or leading space and must not have any of these characters: $()*+?[]^{|}".to_string()).send_self()); |
80 response.add(Bye("Illegal nickname! Nicknames must be between 1-40 characters long, must not have a trailing or leading space and must not have any of these characters: $()*+?[]^{|}".to_string()).send_self()); |