commit aa467b9be060c83d750f8804bf1b030d8abf6156
parent 09eeb57bd918e34e9539d6b823e318f8be43892c
Author: kernelkind <kernelkind@gmail.com>
Date: Thu, 31 Jul 2025 18:51:27 -0400
extract notifications filter to own method
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
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
@@ -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,