diff options
Diffstat (limited to '')
| -rw-r--r-- | lampada/.gitignore | 2 | ||||
| -rw-r--r-- | lampada/Cargo.toml | 3 | ||||
| -rw-r--r-- | lampada/src/main.rs | 42 | 
3 files changed, 0 insertions, 47 deletions
| diff --git a/lampada/.gitignore b/lampada/.gitignore deleted file mode 100644 index 60868fd..0000000 --- a/lampada/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -luz.db -.sqlx/ diff --git a/lampada/Cargo.toml b/lampada/Cargo.toml index 856fd7d..9b42aad 100644 --- a/lampada/Cargo.toml +++ b/lampada/Cargo.toml @@ -10,8 +10,5 @@ peanuts = { version = "0.1.0", path = "../../peanuts" }  jid = { version = "0.1.0", path = "../jid", features = ["sqlx"] }  stanza = { version = "0.1.0", path = "../stanza", features = ["xep_0203"] }  tokio = "1.42.0" -tokio-stream = "0.1.17" -tokio-util = "0.7.13"  tracing = "0.1.41" -tracing-subscriber = "0.3.19"  thiserror = "2.0.11" diff --git a/lampada/src/main.rs b/lampada/src/main.rs deleted file mode 100644 index 7b7469d..0000000 --- a/lampada/src/main.rs +++ /dev/null @@ -1,42 +0,0 @@ -use std::{path::Path, str::FromStr, time::Duration}; - -use jid::JID; -use lampada::{db::Db, CoreClientCommand, LuzHandle}; -use sqlx::SqlitePool; -use tokio::{ -    io::{AsyncReadExt, AsyncWriteExt}, -    sync::oneshot, -}; -use tracing::info; - -#[tokio::main] -async fn main() { -    tracing_subscriber::fmt::init(); -    let db = Db::create_connect_and_migrate(Path::new("./luz.db")) -        .await -        .unwrap(); -    let (luz, mut recv) = -        LuzHandle::new("test@blos.sm".try_into().unwrap(), "slayed".to_string(), db); - -    tokio::spawn(async move { -        while let Some(msg) = recv.recv().await { -            info!("{:#?}", msg) -        } -    }); - -    luz.send(CoreClientCommand::Connect).await.unwrap(); -    let (send, recv) = oneshot::channel(); -    tokio::time::sleep(Duration::from_secs(5)).await; -    info!("sending message"); -    luz.send(CoreClientCommand::SendMessage( -        JID::from_str("cel@blos.sm").unwrap(), -        luz::chat::Body { -            body: "hallo!!!".to_string(), -        }, -        send, -    )) -    .await -    .unwrap(); -    recv.await.unwrap().unwrap(); -    println!("sent message"); -} | 
