From e1ad2e231f790ba4779c41e069a7540f94a40250 Mon Sep 17 00:00:00 2001 From: kernelkind Date: Mon, 8 Sep 2025 15:59:22 -0400 Subject: [PATCH] filter: add repost kind to `FilteredTags::into_filter` Signed-off-by: kernelkind --- crates/notedeck/src/contacts.rs | 4 ++-- crates/notedeck/src/filter.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/notedeck/src/contacts.rs b/crates/notedeck/src/contacts.rs index f6f2cb27..b3f9a128 100644 --- a/crates/notedeck/src/contacts.rs +++ b/crates/notedeck/src/contacts.rs @@ -16,9 +16,9 @@ pub fn hybrid_contacts_filter( with_hashtags: bool, ) -> Result { let local = filter::filter_from_tags(note, add_pk, with_hashtags)? - .into_filter([1], filter::default_limit()); + .into_filter(vec![1], filter::default_limit()); let remote = filter::filter_from_tags(note, add_pk, with_hashtags)? - .into_filter([1, 0], filter::default_remote_limit()); + .into_filter(vec![1, 0], filter::default_remote_limit()); Ok(HybridFilter::split(local, remote)) } diff --git a/crates/notedeck/src/filter.rs b/crates/notedeck/src/filter.rs index 81aecae3..40374362 100644 --- a/crates/notedeck/src/filter.rs +++ b/crates/notedeck/src/filter.rs @@ -271,18 +271,18 @@ impl FilteredTags { } // TODO: make this more general - pub fn into_filter(self, kinds: I, limit: u64) -> Vec - where - I: IntoIterator + Copy, - { + pub fn into_filter(self, shared_kinds: Vec, limit: u64) -> Vec { let mut filters: Vec = Vec::with_capacity(2); if let Some(authors) = self.authors { - filters.push(authors.kinds(kinds).limit(limit).build()) + let mut author_kinds = shared_kinds.clone(); + author_kinds.insert(0, 6); + + filters.push(authors.kinds(author_kinds).limit(limit).build()) } if let Some(hashtags) = self.hashtags { - filters.push(hashtags.kinds(kinds).limit(limit).build()) + filters.push(hashtags.kinds(shared_kinds).limit(limit).build()) } filters