From 8fb219695569330a1353a1eae5dd66bec52fa2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 27 Dec 2021 01:10:47 +0100 Subject: [PATCH] Call upload method with static values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.rs b/src/main.rs index 24d76bb..2e020a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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);