Skip to content
Merged
107 changes: 65 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 19 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ default-members = [
aes = "0.8.3"
aes-gcm = { version = "0.10.2", default-features = false, features = ["aes", "alloc", "std"] }
anyhow = { version = "1.0", default-features = false }
async-channel = { version = "2.5.0", default-features = false }
async-channel = { version = "2.5.0", default-features = false, features = ["std"] }
async-lock = { version = "3", default-features = false }
async-trait = "0.1.89"
base64 = { version = "0.22.1", default-features = false, features = ["alloc"] }
bytemuck = { version = "1.22", default-features = false }
bytes = { version = "1.5", default-features = false, features = ["serde"] }
chrono = { version = "0.4", default-features = false }
ctr = { version = "0.9", default-features = false }
event-listener = { version = "5", default-features = false }
flate2 = { version = "1.1.5", default-features = false, features = ["zlib-rs"] }
futures = { version = "0.3", default-features = false, features = ["alloc", "async-await"] }
hex = { version = "0.4", default-features = false, features = ["alloc"] }
Expand Down Expand Up @@ -78,10 +80,19 @@ wacore-noise = { path = "./wacore/noise", version = "0.3.0" }
waproto = { path = "./waproto", version = "0.3.0" }

[features]
debug-diagnostics = []
debug-snapshots = []
debug-diagnostics = ["wacore/debug-diagnostics"]
debug-snapshots = ["wacore/debug-snapshots"]
danger-skip-tls-verify = ["whatsapp-rust-tokio-transport?/danger-skip-tls-verify"]
default = ["simd", "sqlite-storage", "tokio-transport", "ureq-client", "tokio-native", "signal"]
default = [
"moka-cache",
"simd",
"sqlite-storage",
"tokio-transport",
"ureq-client",
"tokio-native",
"signal",
]
moka-cache = ["dep:moka"]
simd = ["wacore/simd"]
ureq-client = ["dep:whatsapp-rust-ureq-http-client"]
tokio-transport = ["dep:whatsapp-rust-tokio-transport"]
Expand All @@ -92,15 +103,17 @@ tokio-native = ["tokio/rt-multi-thread"]
[dependencies]
anyhow = { workspace = true }
async-channel = { workspace = true }
async-lock = { workspace = true }
async-trait = { workspace = true }
base64 = { workspace = true }
bytes = { workspace = true }
chrono = { workspace = true, features = ["clock", "serde"] }
dashmap = "6.1.0"
env_logger = { version = "0.11", default-features = false }
event-listener = { workspace = true }
futures = { workspace = true, features = ["std"] }
hex = { workspace = true }
log = { workspace = true }
moka = { version = "0.12.12", features = ["future"] }
moka = { version = "0.12.12", features = ["future"], optional = true }
prost = { workspace = true }
rand = { workspace = true }
scopeguard = "1.2"
Expand Down
4 changes: 3 additions & 1 deletion examples/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::sync::Arc;
use wacore::proto_helpers::MessageExt;
use wacore::types::events::Event;
use waproto::whatsapp as wa;
use whatsapp_rust::TokioRuntime;
use whatsapp_rust::bot::{Bot, MessageContext};
use whatsapp_rust::store::SqliteStore;
use whatsapp_rust_tokio_transport::TokioWebSocketTransportFactory;
Expand Down Expand Up @@ -48,7 +49,8 @@ fn main() {
let builder = Bot::builder()
.with_backend(backend)
.with_transport_factory(transport_factory)
.with_http_client(http_client);
.with_http_client(http_client)
.with_runtime(TokioRuntime);

let mut bot = builder
.on_event(move |event, client| async move {
Expand Down
3 changes: 2 additions & 1 deletion http_clients/ureq-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ fn build_agent() -> ureq::Agent {
}
}

#[async_trait]
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
impl HttpClient for UreqHttpClient {
async fn execute(&self, request: HttpRequest) -> Result<HttpResponse> {
let agent = self.agent.clone();
Expand Down
Loading
Loading