summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/client.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client.rs b/src/client.rs
index 901070a..3903fb7 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -195,6 +195,13 @@ pub trait ClientCallbacks {
let err = client.run_loop(|client, m| {
try!(self.on_any_message(client, m));
+ if m.is_reply() {
+ try!(self.on_reply(client, m));
+ }
+ else {
+ try!(self.on_command(client, m));
+ }
+
let from = m.from().as_ref().map(|s| s.as_slice());
let p = m.params().as_slice();
match *m.message_type() {
@@ -833,6 +840,9 @@ pub trait ClientCallbacks {
#[allow(unused_variable)] fn on_invalid_message (&mut self, client: &mut Client, m: &Message) -> io::IoResult<()> { Ok(()) }
#[allow(unused_variable)] fn on_unknown_message (&mut self, client: &mut Client, m: &Message) -> io::IoResult<()> { Ok(()) }
+ #[allow(unused_variable)] fn on_command (&mut self, client: &mut Client, m: &Message) -> io::IoResult<()> { Ok(()) }
+ #[allow(unused_variable)] fn on_reply (&mut self, client: &mut Client, m: &Message) -> io::IoResult<()> { Ok(()) }
+
#[allow(unused_variable)] fn on_pass (&mut self, client: &mut Client, from: Option<&str>, pass: &str) -> io::IoResult<()> { Ok(()) }
#[allow(unused_variable)] fn on_nick (&mut self, client: &mut Client, from: Option<&str>, nick: &str, hopcount: Option<u32>) -> io::IoResult<()> { Ok(()) }
#[allow(unused_variable)] fn on_user (&mut self, client: &mut Client, from: Option<&str>, username: &str, hostname: &str, servername: &str, realname: &str) -> io::IoResult<()> { Ok(()) }