diff options
author | bryan newbold <bnewbold@robocracy.org> | 2023-03-04 19:30:05 -0800 |
---|---|---|
committer | bryan newbold <bnewbold@robocracy.org> | 2023-03-04 19:30:05 -0800 |
commit | 6942f47747f8655cf0702422f457f0476ab29c41 (patch) | |
tree | d826216b019d0a519b208621645dc5d777fb023a /adenosine-pds/src | |
parent | 215003c210ce205f85f6a1488f6fc41685ce1f1f (diff) | |
download | adenosine-6942f47747f8655cf0702422f457f0476ab29c41.tar.gz adenosine-6942f47747f8655cf0702422f457f0476ab29c41.zip |
pds: updates for Thread schema hacks (for CLI)
Diffstat (limited to 'adenosine-pds/src')
-rw-r--r-- | adenosine-pds/src/db_bsky.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/adenosine-pds/src/db_bsky.rs b/adenosine-pds/src/db_bsky.rs index 5e968af..c51979e 100644 --- a/adenosine-pds/src/db_bsky.rs +++ b/adenosine-pds/src/db_bsky.rs @@ -218,7 +218,6 @@ fn feed_row_to_item(srv: &mut AtpService, row: FeedRow) -> Result<app_bsky::Feed avatar: None, viewer: None, }, - repostedBy: None, record: post_record, embed: None, replyCount: reply_count, @@ -337,45 +336,49 @@ pub fn bsky_get_thread( for row in rows { let item = feed_row_to_item(srv, row)?.post; children.push(app_bsky::ThreadPostView { - post: app_bsky::PostView { + post: Some(app_bsky::PostView { uri: item.uri, cid: item.cid, author: item.author, record: item.record, embed: item.embed, - repostedBy: None, replyCount: item.replyCount, upvoteCount: item.upvoteCount, downvoteCount: 0, repostCount: item.repostCount, indexedAt: item.indexedAt, viewer: None, - }, + }), // don't want a loop here parent: None, // only going to depth of one here replies: None, + // for "notfound" + uri: None, + notFound: None, }); } let pip = post_item.post; let post = app_bsky::ThreadPostView { - post: app_bsky::PostView { + post: Some(app_bsky::PostView { uri: pip.uri, cid: pip.cid, author: pip.author, record: pip.record, embed: pip.embed, - repostedBy: None, replyCount: pip.replyCount, upvoteCount: pip.upvoteCount, downvoteCount: 0, repostCount: pip.repostCount, indexedAt: pip.indexedAt, viewer: None, - }, + }), parent, replies: Some(children), + // for "notfound" variant + uri: None, + notFound: None, }; Ok(app_bsky::PostThread { thread: post }) } @@ -614,7 +617,6 @@ fn test_bsky_feeds() { // TODO: CID assert_eq!(alice_feed.feed[2].post.author.did, alice_did.to_string()); assert_eq!(alice_feed.feed[2].post.author.handle, "alice.test"); - assert_eq!(alice_feed.feed[2].post.repostedBy, None); assert_eq!(alice_feed.feed[2].post.record.text, "alice first post"); assert_eq!(alice_feed.feed[2].post.embed, None); assert_eq!(alice_feed.feed[2].post.replyCount, 0); @@ -657,8 +659,6 @@ fn test_bsky_feeds() { // TODO: CID assert_eq!(bob_feed.feed[1].author.did, alice_did.to_string()); assert_eq!(bob_feed.feed[1].author.handle, "alice.test"); - assert_eq!(bob_feed.feed[1].repostedBy.as_ref().unwrap().did, bob_did.to_string()); - assert_eq!(bob_feed.feed[1].repostedBy.as_ref().unwrap().handle, "bob.test"); // TODO: "is a repost" (check record?) */ |