equal
deleted
inserted
replaced
152 } |
152 } |
153 } |
153 } |
154 } else if msg[..].starts_with(b"BYE") { |
154 } else if msg[..].starts_with(b"BYE") { |
155 warn!("Received BYE: {}", String::from_utf8_lossy(&msg[..])); |
155 warn!("Received BYE: {}", String::from_utf8_lossy(&msg[..])); |
156 return Ok(()); |
156 return Ok(()); |
|
157 } else if msg[..].starts_with(b"CHAT") { |
|
158 let body = String::from_utf8_lossy(&msg[5..]); |
|
159 let mut l = body.lines(); |
|
160 info!("Chat [{}]: {}", l.next().unwrap(), l.next().unwrap()); |
|
161 } else if msg[..].starts_with(b"ROOM") { |
|
162 let body = String::from_utf8_lossy(&msg[5..]); |
|
163 let mut l = body.lines(); |
|
164 if let Some(action) = l.next() { |
|
165 if action == "ADD" { |
|
166 info!("Room added: {}", l.skip(1).next().unwrap()); |
|
167 } |
|
168 } |
157 } else if msg[..].starts_with(b"ERROR") { |
169 } else if msg[..].starts_with(b"ERROR") { |
158 warn!("Received ERROR: {}", String::from_utf8_lossy(&msg[..])); |
170 warn!("Received ERROR: {}", String::from_utf8_lossy(&msg[..])); |
159 return Ok(()); |
171 return Ok(()); |
160 } else { |
172 } else { |
161 warn!( |
173 warn!( |