Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ buffa-build = { version = "0.8.1", default-features = false }
buffa-descriptor = { version = "0.8.1", default-features = false }
bytemuck = { version = "1.25", default-features = false }
bytes = { version = "1.12", default-features = false }
bon = { version = "3.9.3", default-features = false, features = ["std"] }
cbc = { version = "0.2", features = ["alloc"] }
chrono = { version = "0.4", default-features = false }
compact_str = { version = "0.9", default-features = false }
Expand Down
21 changes: 11 additions & 10 deletions src/client/node_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1147,16 +1147,17 @@ impl Client {
.has_handler_for(wacore::types::events::EventKind::ServerAck)
&& let Some(id) = &ack_id
{
let ack = wacore::types::events::ServerAck {
id: id.as_str().to_string(),
class: node.get_attr("class").map(|v| v.as_str().to_string()),
from: node.get_attr("from").and_then(|v| v.as_str().parse().ok()),
timestamp: node
.get_attr("t")
.and_then(|v| v.as_str().parse::<i64>().ok())
.and_then(|secs| chrono::DateTime::from_timestamp(secs, 0)),
error: ack_error.as_ref().map(|v| v.as_str().to_string()),
};
let ack = wacore::types::events::ServerAck::builder()
.id(id.as_str().to_string())
.maybe_class(node.get_attr("class").map(|v| v.as_str().to_string()))
.maybe_from(node.get_attr("from").and_then(|v| v.as_str().parse().ok()))
.maybe_timestamp(
node.get_attr("t")
.and_then(|v| v.as_str().parse::<i64>().ok())
.and_then(|secs| chrono::DateTime::from_timestamp(secs, 0)),
)
.maybe_error(ack_error.as_ref().map(|v| v.as_str().to_string()))
.build();
self.core
.event_bus
.dispatch(wacore::types::events::Event::ServerAck(ack));
Expand Down
1 change: 1 addition & 0 deletions wacore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ async-channel = { workspace = true }
async-lock = { workspace = true }
async-trait = { workspace = true }
base64 = { workspace = true }
bon = { workspace = true }
buffa = { workspace = true }
bytes = { workspace = true }
chrono = { workspace = true, features = ["now", "serde"] }
Expand Down
3 changes: 2 additions & 1 deletion wacore/src/types/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,8 @@ pub struct Receipt {
/// outgoing stanza. Server acks cover every outgoing stanza class — message,
/// receipt, notification, call — so consumers should filter on [`class`](Self::class)
/// before correlating ids.
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone, Serialize, bon::Builder)]
#[non_exhaustive]
Comment thread
greptile-apps[bot] marked this conversation as resolved.
pub struct ServerAck {
/// Id of the acked stanza (for a sent message, its message id).
pub id: String,
Expand Down
Loading