Updates query for threads

Previous query incorrectly pulled and sorted posts, often showing years
old posts from newly followed people. This now behaves more consistently
as "recent threads from people in your extended network".
This commit is contained in:
Nick Wynja 2020-03-31 10:34:47 -04:00
parent 573d7096f3
commit 0e698df8f3
1 changed files with 16 additions and 6 deletions

View File

@ -936,12 +936,22 @@ module.exports = ({ cooler, isPublic }) => {
const myFeedId = ssb.id;
const options = configure({
type: "post",
private: false,
});
const source = ssb.messagesByType(options);
const source = ssb.query.read(
configure({
query: [
{
$filter: {
value: {
timestamp: { $lte: Date.now() },
content: {
type: "post",
},
},
},
},
],
})
);
const messages = await new Promise((resolve, reject) => {
pull(