Call upload method with static values

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2021-12-27 01:10:47 +01:00
parent e26d1c9e19
commit 8fb2196955
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -7,6 +7,8 @@
use env_logger;
use std::env::args;
use xmpp::{ClientBuilder, ClientType, Event};
use std::path::Path;
use xmpp::{ClientBuilder, ClientFeature, ClientType, Event};
#[tokio::main]
async fn main() -> Result<(), Option<()>> {
@ -33,7 +35,14 @@ async fn main() -> Result<(), Option<()>> {
match event {
Event::Online => {
println!("Online.");
client.upload_file_with(
"share.serv.ice"
Path::new("/some/file/path"),
).await;
}
Event::HTTPUploadedFile(url) => {
println!("URL: {}", url);
},
Event::Disconnected => {
println!("Disconnected");
return Err(None);