From 2b630817278e77f08f1fecdf0729b1cd9a8dbb83 Mon Sep 17 00:00:00 2001 From: "andrej.zirko" Date: Tue, 20 Dec 2022 12:28:17 +0100 Subject: [PATCH] Added attachment id to the forward message --- src/protocols/routing/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/protocols/routing/mod.rs b/src/protocols/routing/mod.rs index 7137c6b..84ec108 100644 --- a/src/protocols/routing/mod.rs +++ b/src/protocols/routing/mod.rs @@ -133,6 +133,10 @@ fn generate_message_id() -> String { Uuid::new_v4().to_string() } +fn generate_attachment_id() -> String { + Uuid::new_v4().to_string() +} + fn build_forward_message( forwarded_msg: &str, next: &str, @@ -147,6 +151,7 @@ fn build_forward_message( serde_json::from_str(forwarded_msg) .kind(ErrorKind::Malformed, "Unable deserialize forwarded message")?, ) + .id(generate_attachment_id()) .finalize(); let mut msg_builder = Message::build(generate_message_id(), FORWARD_MSG_TYPE.to_owned(), body);