extract notifications filter to own method

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-07-31 18:51:27 -04:00
parent 09eeb57bd9
commit aa467b9be0

View File

@@ -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,