From aa467b9be060c83d750f8804bf1b030d8abf6156 Mon Sep 17 00:00:00 2001 From: kernelkind Date: Thu, 31 Jul 2025 18:51:27 -0400 Subject: [PATCH] extract notifications filter to own method Signed-off-by: kernelkind --- crates/notedeck_columns/src/timeline/kind.rs | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/crates/notedeck_columns/src/timeline/kind.rs b/crates/notedeck_columns/src/timeline/kind.rs index dc4762db..84314bd8 100644 --- a/crates/notedeck_columns/src/timeline/kind.rs +++ b/crates/notedeck_columns/src/timeline/kind.rs @@ -471,11 +471,9 @@ impl TimelineKind { }, // TODO: still need to update this to fetch likes, zaps, etc - TimelineKind::Notifications(pubkey) => FilterState::ready(vec![Filter::new() - .pubkeys([pubkey.bytes()]) - .kinds([1]) - .limit(default_limit()) - .build()]), + TimelineKind::Notifications(pubkey) => { + FilterState::ready(vec![notifications_filter(pubkey)]) + } TimelineKind::Hashtag(hashtag) => { let filters = hashtag @@ -573,11 +571,7 @@ impl TimelineKind { )), TimelineKind::Notifications(pk) => { - let notifications_filter = Filter::new() - .pubkeys([pk.bytes()]) - .kinds([1]) - .limit(default_limit()) - .build(); + let notifications_filter = notifications_filter(&pk); Some(Timeline::new( TimelineKind::notifications(pk), @@ -628,6 +622,14 @@ impl TimelineKind { } } +pub fn notifications_filter(pk: &Pubkey) -> Filter { + Filter::new() + .pubkeys([pk.bytes()]) + .kinds([1]) + .limit(default_limit()) + .build() +} + #[derive(Debug)] pub struct TitleNeedsDb<'a> { kind: &'a TimelineKind,