From 04b1504e8715ee6acf498a4261775f3b9d6d6daa Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 13 Jan 2024 20:35:13 +0100 Subject: Add stream Actor and Tag structs and complete StreamItem. --- src/stream/streamitem.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/stream/streamitem.rs') diff --git a/src/stream/streamitem.rs b/src/stream/streamitem.rs index d30be9e..3040dea 100644 --- a/src/stream/streamitem.rs +++ b/src/stream/streamitem.rs @@ -7,7 +7,9 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ +use super::actor::Actor; use super::datetime::DateTime; +use super::Tag; use super::verb::Verb; use serde::Deserialize; @@ -26,6 +28,12 @@ pub enum StreamItemEncoding { Zot, } +#[derive(Debug, Deserialize, PartialEq)] +pub enum StreamItemFlag { + #[serde(rename="thread_parent")] + ThreadParent, +} + /** * Represents an item as returned by the stream API's. */ @@ -56,6 +64,13 @@ pub struct StreamItem { pub title: String, pub summary: String, pub body: String, + + pub owner: Actor, + pub author: Actor, + + pub signature: String, + pub flags: Vec, + pub tags: Vec, } impl StreamItem { @@ -163,5 +178,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]); } } -- cgit v1.2.3