filter: add repost kind to FilteredTags::into_filter

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-09-08 15:59:22 -04:00
parent 91028929b2
commit e1ad2e231f
2 changed files with 8 additions and 8 deletions

View File

@@ -16,9 +16,9 @@ pub fn hybrid_contacts_filter(
with_hashtags: bool, with_hashtags: bool,
) -> Result<HybridFilter, Error> { ) -> Result<HybridFilter, Error> {
let local = filter::filter_from_tags(note, add_pk, with_hashtags)? 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)? 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)) Ok(HybridFilter::split(local, remote))
} }

View File

@@ -271,18 +271,18 @@ impl FilteredTags {
} }
// TODO: make this more general // TODO: make this more general
pub fn into_filter<I>(self, kinds: I, limit: u64) -> Vec<Filter> pub fn into_filter(self, shared_kinds: Vec<u64>, limit: u64) -> Vec<Filter> {
where
I: IntoIterator<Item = u64> + Copy,
{
let mut filters: Vec<Filter> = Vec::with_capacity(2); let mut filters: Vec<Filter> = Vec::with_capacity(2);
if let Some(authors) = self.authors { 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 { if let Some(hashtags) = self.hashtags {
filters.push(hashtags.kinds(kinds).limit(limit).build()) filters.push(hashtags.kinds(shared_kinds).limit(limit).build())
} }
filters filters