summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-09-03 19:42:16 -0400
committerJesse Luehrs <doy@tozt.net>2014-09-03 19:42:16 -0400
commit0d1ebb2da9e05966d6b3e6084186c65836b56668 (patch)
treef3c35313bbd2cd1f7a0fb3f25a0fd3a3fed6531a
parentb061c3c5d751f33bfa1d947d2c77928f2db50d51 (diff)
downloadrust-irc-0d1ebb2da9e05966d6b3e6084186c65836b56668.tar.gz
rust-irc-0d1ebb2da9e05966d6b3e6084186c65836b56668.zip
write some login messages on connect in the example
-rw-r--r--examples/client.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/client.rs b/examples/client.rs
index ce563e0..90a6b32 100644
--- a/examples/client.rs
+++ b/examples/client.rs
@@ -1,8 +1,31 @@
extern crate irc;
+use irc::constants::{CommandMessage, Nick, User};
+
fn main () {
let mut client = irc::Client::new("doytest", "chat.freenode.net", 6667);
client.connect();
+
+ client.write(
+ irc::Message::new(
+ None,
+ CommandMessage(Nick),
+ vec!["doytest".to_string()],
+ )
+ );
+ client.write(
+ irc::Message::new(
+ None,
+ CommandMessage(User),
+ vec![
+ "doytest".to_string(),
+ "localhost".to_string(),
+ "localhost".to_string(),
+ "doytest".to_string(),
+ ],
+ )
+ );
+
loop {
let res = client.read();
println!("{}", res);