From ee33d2559d6695149a6a15b948ae2ab1a254e251 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 19 Dec 2022 23:59:55 -0800 Subject: pds: make 'cid' required in feed items --- adenosine-pds/src/bsky.rs | 2 +- adenosine-pds/src/models.rs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/adenosine-pds/src/bsky.rs b/adenosine-pds/src/bsky.rs index c976be2..db6353a 100644 --- a/adenosine-pds/src/bsky.rs +++ b/adenosine-pds/src/bsky.rs @@ -200,7 +200,7 @@ fn feed_row_to_item(srv: &mut AtpService, row: FeedRow) -> Result { let feed_item = FeedItem { uri, - cid: Some(row.item_post_cid.to_string()), + cid: row.item_post_cid.to_string(), author: User { did: row.item_did.to_string(), handle: row.item_handle, diff --git a/adenosine-pds/src/models.rs b/adenosine-pds/src/models.rs index 573ff2f..f827a7a 100644 --- a/adenosine-pds/src/models.rs +++ b/adenosine-pds/src/models.rs @@ -169,8 +169,7 @@ pub struct User { #[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] pub struct FeedItem { pub uri: String, - // TODO: cid is required - pub cid: Option, + pub cid: String, pub author: User, pub repostedBy: Option, pub record: Value, @@ -211,8 +210,7 @@ pub struct PostThread { #[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] pub struct ThreadItem { pub uri: String, - // TODO: CID is required - pub cid: Option, + pub cid: String, pub author: User, pub record: Value, //pub embed?: RecordEmbed | ExternalEmbed | UnknownEmbed, -- cgit v1.2.3