From 48adb72f3d988baf58fdf6ed7143a40e309a6f87 Mon Sep 17 00:00:00 2001 From: Xavrax Date: Mon, 9 Dec 2024 20:22:55 +0100 Subject: [PATCH] rest of the functions --- src/dx/publish/mod.rs | 7 +++++-- src/dx/subscribe/event_dispatcher.rs | 6 +++--- src/dx/subscribe/event_engine/effects/emit_messages.rs | 2 +- src/dx/subscribe/result.rs | 6 +++--- src/dx/subscribe/types.rs | 6 +++--- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/dx/publish/mod.rs b/src/dx/publish/mod.rs index bd59da86..e085974d 100644 --- a/src/dx/publish/mod.rs +++ b/src/dx/publish/mod.rs @@ -499,10 +499,13 @@ mod should { ("norep".to_string(), "true".to_string()), ("store".to_string(), "1".to_string()), ("space-id".to_string(), "space_id".to_string()), - ("type".to_string(), "message_type".to_string()), + ( + "custom_message_type".to_string(), + "message_type".to_string() + ), ("meta".to_string(), "{\"k\":\"v\"}".to_string()), ("ttl".to_string(), "50".to_string()), - ("seqn".to_string(), "1".to_string()) + ("seqn".to_string(), "1".to_string()), ]), result.data.query_parameters ); diff --git a/src/dx/subscribe/event_dispatcher.rs b/src/dx/subscribe/event_dispatcher.rs index bb2007a5..7aee1b18 100644 --- a/src/dx/subscribe/event_dispatcher.rs +++ b/src/dx/subscribe/event_dispatcher.rs @@ -430,7 +430,7 @@ mod it_should { channel: "test-channel".to_string(), subscription: "test-channel".to_string(), data: "Test message 1".to_string().into_bytes(), - r#type: None, + custom_message_type: None, space_id: None, decryption_error: None, }), @@ -440,7 +440,7 @@ mod it_should { channel: "test-channel".to_string(), subscription: "test-channel".to_string(), data: "Test signal 1".to_string().into_bytes(), - r#type: None, + custom_message_type: None, space_id: None, decryption_error: None, }), @@ -459,7 +459,7 @@ mod it_should { channel: "test-channel".to_string(), subscription: "test-channel".to_string(), data: "Test message 2".to_string().into_bytes(), - r#type: None, + custom_message_type: None, space_id: None, decryption_error: None, }), diff --git a/src/dx/subscribe/event_engine/effects/emit_messages.rs b/src/dx/subscribe/event_engine/effects/emit_messages.rs index a8c542c6..b3a2e6ed 100644 --- a/src/dx/subscribe/event_engine/effects/emit_messages.rs +++ b/src/dx/subscribe/event_engine/effects/emit_messages.rs @@ -34,7 +34,7 @@ mod should { channel: "test".to_string(), subscription: "test-group".to_string(), data: vec![], - r#type: None, + custom_message_type: None, space_id: None, decryption_error: None, }; diff --git a/src/dx/subscribe/result.rs b/src/dx/subscribe/result.rs index a393d901..6930fe94 100644 --- a/src/dx/subscribe/result.rs +++ b/src/dx/subscribe/result.rs @@ -257,11 +257,11 @@ pub struct Envelope { pub subscription: Option, /// User provided message type (set only when [`publish`] called with - /// `r#type`). + /// `custom_message_type`). /// /// [`publish`]: crate::dx::publish - #[cfg_attr(feature = "serde", serde(rename = "mt"), serde(default))] - pub r#type: Option, + #[cfg_attr(feature = "serde", serde(rename = "cmt"), serde(default))] + pub custom_message_type: Option, /// Identifier of space into which message has been published (set only when /// [`publish`] called with `space_id`). diff --git a/src/dx/subscribe/types.rs b/src/dx/subscribe/types.rs index a44a8a6a..f3cb0aaf 100644 --- a/src/dx/subscribe/types.rs +++ b/src/dx/subscribe/types.rs @@ -470,10 +470,10 @@ pub struct Message { pub data: Vec, /// User provided message type (set only when [`publish`] called with - /// `r#type`). + /// `custom_message_type`). /// /// [`publish`]: crate::dx::publish - pub r#type: Option, + pub custom_message_type: Option, /// Identifier of space into which message has been published (set only when /// [`publish`] called with `space_id`). @@ -1097,7 +1097,7 @@ impl TryFrom for Message { channel: value.channel, subscription, data: value.payload.into(), - r#type: value.r#type, + custom_message_type: value.custom_message_type, space_id: value.space_id, decryption_error: None, })