diff options
author | Till Hoeppner | 2015-04-20 20:54:13 +0200 |
---|---|---|
committer | Till Hoeppner | 2015-04-20 20:57:04 +0200 |
commit | cabbd084f89908e91b81300a776cbeb5034396b8 (patch) | |
tree | c29bb2aca28b2827133d54bdb64b131da21e2a4a /src/server.rs | |
parent | 3cee55e3bfd1c853e1ff4fa71a690f1ad1d6e37e (diff) | |
download | irsc-cabbd084f89908e91b81300a776cbeb5034396b8.tar.gz irsc-cabbd084f89908e91b81300a776cbeb5034396b8.tar.xz irsc-cabbd084f89908e91b81300a776cbeb5034396b8.zip |
Something inbetween working and broken
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()) } |