diff --git a/src/filter.rs b/src/filter.rs index 1337c79..85a08ee 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -85,11 +85,11 @@ pub fn since_optimize_filter(filter: Filter, notes: &[NoteRef]) -> Filter { } pub fn default_limit() -> u64 { - 250 + 500 } pub fn default_remote_limit() -> u64 { - 150 + 250 } pub struct FilteredTags { @@ -99,22 +99,22 @@ pub struct FilteredTags { impl FilteredTags { pub fn into_follow_filter(self) -> Vec { - self.into_filter([1]) + self.into_filter([1], default_limit()) } // TODO: make this more general - pub fn into_filter(self, kinds: I) -> Vec + pub fn into_filter(self, kinds: I, limit: u64) -> Vec where I: IntoIterator + Copy, { let mut filters: Vec = Vec::with_capacity(2); if let Some(authors) = self.authors { - filters.push(authors.kinds(kinds).build()) + filters.push(authors.kinds(kinds).limit(limit).build()) } if let Some(hashtags) = self.hashtags { - filters.push(hashtags.kinds(kinds).build()) + filters.push(hashtags.kinds(kinds).limit(limit).build()) } filters