From 289444176804d31415b70b8386a41e9c769fdc3d Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Sat, 7 Jan 2023 12:15:33 +1300 Subject: [PATCH] Person feed now goes back 25 posts, not limited by timespan --- src/overlord/minion/mod.rs | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/overlord/minion/mod.rs b/src/overlord/minion/mod.rs index cd9a5d9f..caf89d94 100644 --- a/src/overlord/minion/mod.rs +++ b/src/overlord/minion/mod.rs @@ -391,21 +391,36 @@ impl Minion { // NOTE we do not unsubscribe to the general feed let mut filters: Vec = Vec::new(); + let feed_chunk = GLOBALS.settings.read().await.feed_chunk; - // feed related by person + // Posts made by the person filters.push(Filter { - authors: vec![pubkey], + authors: vec![pubkey.clone()], kinds: vec![ EventKind::TextNote, - EventKind::Reaction, EventKind::EventDeletion, ], - since: Some(Unixtime::now().unwrap() - Duration::from_secs(feed_chunk)), + // No since, just a limit on quantity of posts + limit: Some(25), + ..Default::default() + }); + + // Reactions to posts made by the person + // (presuming people include a 'p' tag in their reactions) + filters.push(Filter { + kinds: vec![ + EventKind::Reaction + ], + p: vec![pubkey], + // Limited in time just so we aren't overwhelmed. Generally we only need reactions + // to their most recent posts. This is a very sloppy and approximate solution. + since: Some(Unixtime::now().unwrap() - Duration::from_secs(feed_chunk*25)), ..Default::default() }); // persons metadata + // we don't display this stuff in their feed, so probably take this out. // FIXME TBD /* filters.push(Filter { @@ -416,9 +431,6 @@ impl Minion { }); */ - // reactions to post by person - // FIXME TBD - // NO REPLIES OR ANCESTORS if filters.is_empty() {