mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
add stanza_debug to client example when STANZA_DEBUG is in the env
This commit is contained in:
parent
264e58b1bf
commit
313e7a1770
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@ extern crate xmpp;
|
||||||
|
|
||||||
use xmpp::jid::Jid;
|
use xmpp::jid::Jid;
|
||||||
use xmpp::client::ClientBuilder;
|
use xmpp::client::ClientBuilder;
|
||||||
|
use xmpp::plugins::stanza_debug::StanzaDebugPlugin;
|
||||||
use xmpp::plugins::stanza::StanzaPlugin;
|
use xmpp::plugins::stanza::StanzaPlugin;
|
||||||
use xmpp::plugins::unhandled_iq::UnhandledIqPlugin;
|
use xmpp::plugins::unhandled_iq::UnhandledIqPlugin;
|
||||||
use xmpp::plugins::messaging::{MessagingPlugin, MessageEvent};
|
use xmpp::plugins::messaging::{MessagingPlugin, MessageEvent};
|
||||||
|
@ -20,6 +21,9 @@ fn main() {
|
||||||
.password(pass)
|
.password(pass)
|
||||||
.connect()
|
.connect()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
if env::var("STANZA_DEBUG").is_ok() {
|
||||||
|
client.register_plugin(StanzaDebugPlugin::new());
|
||||||
|
}
|
||||||
client.register_plugin(StanzaPlugin::new());
|
client.register_plugin(StanzaPlugin::new());
|
||||||
client.register_plugin(UnhandledIqPlugin::new());
|
client.register_plugin(UnhandledIqPlugin::new());
|
||||||
client.register_plugin(MessagingPlugin::new());
|
client.register_plugin(MessagingPlugin::new());
|
||||||
|
|
Loading…
Reference in a new issue