Messages now properly end with new-lines.

This commit is contained in:
Aaron Weiss 2014-11-03 03:02:35 -05:00
parent 16f29f179a
commit cd52c5b6a4
2 changed files with 2 additions and 2 deletions

View file

@ -48,6 +48,7 @@ impl Message {
ret.push_str(" :");
ret.push_str(suffix[]);
}
ret.push_str("\r\n");
ret
}
}

View file

@ -72,8 +72,7 @@ impl<'a, T, U> IrcServer<'a, T, U> where T: IrcWriter, U: IrcReader {
fn handle_message(&self, message: &Message) {
if message.command[] == "PING" {
self.send(PONG(message.args[0][], None)).unwrap();
println!("PING! PONG!");
self.send(PONG(message.suffix.as_ref().unwrap()[], None)).unwrap();
}
/* TODO: implement more message handling */
}