Adapt new event system for component
This commit is contained in:
parent
917b14b5d2
commit
2ee23c1c05
3 changed files with 54 additions and 54 deletions
|
|
@ -2,7 +2,6 @@ extern crate xmpp;
|
|||
|
||||
use xmpp::jid::Jid;
|
||||
use xmpp::component::ComponentBuilder;
|
||||
use xmpp::plugins::messaging::{MessagingPlugin, MessageEvent};
|
||||
|
||||
use std::env;
|
||||
|
||||
|
|
@ -17,11 +16,5 @@ fn main() {
|
|||
.port(port)
|
||||
.connect()
|
||||
.unwrap();
|
||||
component.register_plugin(MessagingPlugin::new());
|
||||
loop {
|
||||
let event = component.next_event().unwrap();
|
||||
if let Some(evt) = event.downcast::<MessageEvent>() {
|
||||
println!("{:?}", evt);
|
||||
}
|
||||
}
|
||||
component.main().unwrap();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue