aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream/streamitem.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream/streamitem.rs')
-rw-r--r--src/stream/streamitem.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/stream/streamitem.rs b/src/stream/streamitem.rs
index 3040dea..51382fc 100644
--- a/src/stream/streamitem.rs
+++ b/src/stream/streamitem.rs
@@ -17,20 +17,23 @@ use url::Url;
use uuid::Uuid;
#[derive(Debug, Deserialize, PartialEq)]
+#[serde(rename_all="snake_case")]
pub enum StreamItemType {
- #[serde(rename="activity")]
Activity,
}
#[derive(Debug, Deserialize, PartialEq)]
+#[serde(rename_all="snake_case")]
pub enum StreamItemEncoding {
- #[serde(rename="zot")]
Zot,
}
#[derive(Debug, Deserialize, PartialEq)]
+#[serde(rename_all="snake_case")]
pub enum StreamItemFlag {
- #[serde(rename="thread_parent")]
+ Direct,
+ Notshown,
+ Private,
ThreadParent,
}
@@ -69,8 +72,8 @@ pub struct StreamItem {
pub author: Actor,
pub signature: String,
- pub flags: Vec<StreamItemFlag>,
- pub tags: Vec<Tag>,
+ pub flags: Option<Vec<StreamItemFlag>>,
+ pub tags: Option<Vec<Tag>>,
}
impl StreamItem {
@@ -178,6 +181,6 @@ mod test {
assert_eq!("2023-12-12 17:00:42", &item.edited.to_string());
assert_eq!("0000-00-00 00:00:00", &item.expires.to_string());
assert_eq!("2023-12-19 09:01:15", &item.commented.to_string());
- assert_eq!(StreamItemFlag::ThreadParent, item.flags[0]);
+ assert_eq!(StreamItemFlag::ThreadParent, item.flags.unwrap()[0]);
}
}