Merge branch 'master' of gitlab.com:lumi/xmpp-rs
This commit is contained in:
commit
ac7c907e9f
3 changed files with 59 additions and 106 deletions
|
|
@ -2,8 +2,9 @@ extern crate xmpp;
|
|||
|
||||
use xmpp::jid::Jid;
|
||||
use xmpp::client::ClientBuilder;
|
||||
use xmpp::plugins::stanza::StanzaPlugin;
|
||||
use xmpp::plugins::messaging::{MessagingPlugin, MessageEvent};
|
||||
use xmpp::plugins::presence::{PresencePlugin, Show};
|
||||
use xmpp::plugins::presence::{PresencePlugin, Type};
|
||||
use xmpp::plugins::ping::{PingPlugin, PingEvent};
|
||||
use xmpp::event::{Priority, Propagation};
|
||||
|
||||
|
|
@ -16,6 +17,7 @@ fn main() {
|
|||
.password(pass)
|
||||
.connect()
|
||||
.unwrap();
|
||||
client.register_plugin(StanzaPlugin::new());
|
||||
client.register_plugin(MessagingPlugin::new());
|
||||
client.register_plugin(PresencePlugin::new());
|
||||
client.register_plugin(PingPlugin::new());
|
||||
|
|
@ -23,6 +25,6 @@ fn main() {
|
|||
println!("{:?}", e);
|
||||
Propagation::Continue
|
||||
});
|
||||
client.plugin::<PresencePlugin>().set_presence(Show::Available, None).unwrap();
|
||||
client.plugin::<PresencePlugin>().set_presence(Type::Available, None, None).unwrap();
|
||||
client.main().unwrap();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue