diff options
Diffstat (limited to 'src/server.rs')
-rw-r--r-- | src/server.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/server.rs b/src/server.rs index a8c2819..e5548ef 100644 --- a/src/server.rs +++ b/src/server.rs @@ -8,11 +8,10 @@ use std::io::{ use std::net::TcpStream; -use message; -use message::{ Command, Message }; +use message::Message; +use command::Command; use ::{ DEBUG, Result, IrscError }; - #[cfg(feature = "ssl")] use openssl::ssl::{ SslContext, SslMethod, SslStream }; @@ -62,9 +61,9 @@ impl Server { } } - fn handle_event(&mut self, msg: &message::Message) { + fn handle_event(&mut self, msg: &Message) { if *msg.command == "PING" { - let _ = self.send(Command::Pong { server1: msg.suffix.clone(), server2: None }.to_message()); + let _ = self.send(Command::PONG(msg.suffix, None).to_message()); } } @@ -109,7 +108,7 @@ impl Server { .map_err(IrscError::Io)) } - pub fn send(&mut self, msg: message::Message) -> Result<()> { + pub fn send(&mut self, msg: Message) -> Result<()> { self.sendraw(&msg.to_string()) } |