Skip to content

Commit

Permalink
rest of the functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavrax committed Dec 9, 2024
1 parent 70214da commit 48adb72
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
7 changes: 5 additions & 2 deletions src/dx/publish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
6 changes: 3 additions & 3 deletions src/dx/subscribe/event_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
Expand All @@ -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,
}),
Expand All @@ -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,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/dx/subscribe/event_engine/effects/emit_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
6 changes: 3 additions & 3 deletions src/dx/subscribe/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@ pub struct Envelope {
pub subscription: Option<String>,

/// 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<String>,
#[cfg_attr(feature = "serde", serde(rename = "cmt"), serde(default))]
pub custom_message_type: Option<String>,

/// Identifier of space into which message has been published (set only when
/// [`publish`] called with `space_id`).
Expand Down
6 changes: 3 additions & 3 deletions src/dx/subscribe/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,10 @@ pub struct Message {
pub data: Vec<u8>,

/// User provided message type (set only when [`publish`] called with
/// `r#type`).
/// `custom_message_type`).
///
/// [`publish`]: crate::dx::publish
pub r#type: Option<String>,
pub custom_message_type: Option<String>,

/// Identifier of space into which message has been published (set only when
/// [`publish`] called with `space_id`).
Expand Down Expand Up @@ -1097,7 +1097,7 @@ impl TryFrom<Envelope> 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,
})
Expand Down

0 comments on commit 48adb72

Please sign in to comment.