add jid to Event::Online

breaks the API
This commit is contained in:
Astro 2019-10-15 22:02:14 +02:00
commit 9a5c95694b
4 changed files with 18 additions and 6 deletions

View file

@ -47,7 +47,10 @@ fn main() {
if wait_for_stream_end {
/* Do nothing */
} else if event.is_online() {
println!("Online!");
let jid = event.get_jid()
.map(|jid| format!("{}", jid))
.unwrap_or("unknown".to_owned());
println!("Online at {}", jid);
let presence = make_presence();
tx.start_send(Packet::Stanza(presence)).unwrap();