aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine-pds/src/bsky.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-12-19 23:58:42 -0800
committerbryan newbold <bnewbold@robocracy.org>2022-12-20 00:29:58 -0800
commit8d020c0088dce778c25c43c2572a6c197869a208 (patch)
treebeafc3e4b5ed61371b8f19e9fdf42757fd43f167 /adenosine-pds/src/bsky.rs
parent83569230701b17a0c24c1c9bdd197629649d92bc (diff)
downloadadenosine-8d020c0088dce778c25c43c2572a6c197869a208.tar.gz
adenosine-8d020c0088dce778c25c43c2572a6c197869a208.zip
pds: upvoteCount, not likesCount
Only fixing the display and types (including schema), not actually implementing vote counting in repo or database.
Diffstat (limited to 'adenosine-pds/src/bsky.rs')
-rw-r--r--adenosine-pds/src/bsky.rs18
1 files changed, 11 insertions, 7 deletions
diff --git a/adenosine-pds/src/bsky.rs b/adenosine-pds/src/bsky.rs
index 7be72f0..c976be2 100644
--- a/adenosine-pds/src/bsky.rs
+++ b/adenosine-pds/src/bsky.rs
@@ -211,7 +211,8 @@ fn feed_row_to_item(srv: &mut AtpService, row: FeedRow) -> Result<FeedItem> {
embed: None,
replyCount: reply_count,
repostCount: repost_count,
- likeCount: like_count,
+ upvoteCount: like_count,
+ downvoteCount: 0,
indexedAt: row.indexed_at,
myState: None,
};
@@ -330,7 +331,8 @@ pub fn bsky_get_thread(
replyCount: item.replyCount,
// only going to depth of one here
replies: None,
- likeCount: item.likeCount,
+ upvoteCount: item.upvoteCount,
+ downvoteCount: 0,
repostCount: item.repostCount,
indexedAt: item.indexedAt,
myState: None,
@@ -346,7 +348,8 @@ pub fn bsky_get_thread(
parent,
replyCount: post_item.replyCount,
replies: Some(children),
- likeCount: post_item.likeCount,
+ upvoteCount: post_item.upvoteCount,
+ downvoteCount: 0,
repostCount: post_item.repostCount,
indexedAt: post_item.indexedAt,
myState: None,
@@ -604,17 +607,18 @@ fn test_bsky_feeds() {
assert_eq!(alice_feed.feed[2].embed, None);
assert_eq!(alice_feed.feed[2].replyCount, 0);
assert_eq!(alice_feed.feed[2].repostCount, 0);
- assert_eq!(alice_feed.feed[2].likeCount, 1);
+ assert_eq!(alice_feed.feed[2].upvoteCount, 1);
+ assert_eq!(alice_feed.feed[2].downvoteCount, 0);
assert_eq!(alice_feed.feed[1].author.did, alice_did.to_string());
assert_eq!(alice_feed.feed[1].replyCount, 0);
assert_eq!(alice_feed.feed[1].repostCount, 1);
- assert_eq!(alice_feed.feed[1].likeCount, 0);
+ assert_eq!(alice_feed.feed[1].upvoteCount, 0);
assert_eq!(alice_feed.feed[0].author.did, alice_did.to_string());
assert_eq!(alice_feed.feed[0].replyCount, 1);
assert_eq!(alice_feed.feed[0].repostCount, 0);
- assert_eq!(alice_feed.feed[0].likeCount, 0);
+ assert_eq!(alice_feed.feed[0].upvoteCount, 0);
// test bob timeline: should include alice posts
let bob_timeline = bsky_get_timeline(&mut srv, &bob_did).unwrap();
@@ -760,7 +764,7 @@ fn test_bsky_thread() {
assert_eq!(post.embed, None);
assert_eq!(post.replyCount, 1);
assert_eq!(post.repostCount, 0);
- assert_eq!(post.likeCount, 0);
+ assert_eq!(post.upvoteCount, 0);
assert_eq!(post.replies.as_ref().unwrap().len(), 1);
let post_replies = post.replies.unwrap();