commit e1ad2e231f790ba4779c41e069a7540f94a40250
parent 91028929b243fb28eaf596a379235825faea6a2b
Author: kernelkind <kernelkind@gmail.com>
Date: Mon, 8 Sep 2025 15:59:22 -0400
filter: add repost kind to `FilteredTags::into_filter`
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git 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<HybridFilter, Error> {
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
@@ -271,18 +271,18 @@ impl FilteredTags {
}
// TODO: make this more general
- pub fn into_filter<I>(self, kinds: I, limit: u64) -> Vec<Filter>
- where
- I: IntoIterator<Item = u64> + Copy,
- {
+ pub fn into_filter(self, shared_kinds: Vec<u64>, limit: u64) -> Vec<Filter> {
let mut filters: Vec<Filter> = 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