Update xmpp/parsers and env_logger deps

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2023-08-21 00:28:01 +02:00
parent 62fb3c6023
commit 4d35662f5c
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2
2 changed files with 7 additions and 6 deletions

View file

@ -7,11 +7,11 @@ keywords = ["xmpp", "jabber", "upload"]
license = "AGPL-3.0-or-later" license = "AGPL-3.0-or-later"
[dependencies] [dependencies]
env_logger = "0.8" env_logger = "0.10"
log = "0.4" log = "0.4"
tokio = "1" tokio = "1"
xmpp = "0.3" xmpp = "0.4"
xmpp-parsers = "0.19" xmpp-parsers = "0.20"
[patch.crates-io] [patch.crates-io]
jid = { path = "../xmpp-rs/jid" } jid = { path = "../xmpp-rs/jid" }

View file

@ -7,7 +7,9 @@
use env_logger; use env_logger;
use std::env::args; use std::env::args;
use std::path::Path; use std::path::Path;
use std::str::FromStr;
use xmpp::{ClientBuilder, ClientType, Event}; use xmpp::{ClientBuilder, ClientType, Event};
use xmpp_parsers::BareJid;
#[tokio::main] #[tokio::main]
async fn main() -> Result<(), Option<()>> { async fn main() -> Result<(), Option<()>> {
@ -24,12 +26,11 @@ async fn main() -> Result<(), Option<()>> {
let file = Path::new(&args[4]); let file = Path::new(&args[4]);
// Client instance // Client instance
let mut client = ClientBuilder::new(jid, password) let mut client = ClientBuilder::new(BareJid::from_str(jid).unwrap(), password)
.set_client(ClientType::Bot, "upload-rs") .set_client(ClientType::Bot, "upload-rs")
.set_website("https://gitlab.com/xmpp-rs/xmpp-rs") .set_website("https://gitlab.com/xmpp-rs/xmpp-rs")
.set_default_nick("uploaders") .set_default_nick("uploaders")
.build() .build();
.unwrap();
'outer: while let Some(events) = client.wait_for_events().await { 'outer: while let Some(events) = client.wait_for_events().await {
for event in events { for event in events {