extract notifications filter to own method
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -471,11 +471,9 @@ impl TimelineKind {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// TODO: still need to update this to fetch likes, zaps, etc
|
// TODO: still need to update this to fetch likes, zaps, etc
|
||||||
TimelineKind::Notifications(pubkey) => FilterState::ready(vec![Filter::new()
|
TimelineKind::Notifications(pubkey) => {
|
||||||
.pubkeys([pubkey.bytes()])
|
FilterState::ready(vec![notifications_filter(pubkey)])
|
||||||
.kinds([1])
|
}
|
||||||
.limit(default_limit())
|
|
||||||
.build()]),
|
|
||||||
|
|
||||||
TimelineKind::Hashtag(hashtag) => {
|
TimelineKind::Hashtag(hashtag) => {
|
||||||
let filters = hashtag
|
let filters = hashtag
|
||||||
@@ -573,11 +571,7 @@ impl TimelineKind {
|
|||||||
)),
|
)),
|
||||||
|
|
||||||
TimelineKind::Notifications(pk) => {
|
TimelineKind::Notifications(pk) => {
|
||||||
let notifications_filter = Filter::new()
|
let notifications_filter = notifications_filter(&pk);
|
||||||
.pubkeys([pk.bytes()])
|
|
||||||
.kinds([1])
|
|
||||||
.limit(default_limit())
|
|
||||||
.build();
|
|
||||||
|
|
||||||
Some(Timeline::new(
|
Some(Timeline::new(
|
||||||
TimelineKind::notifications(pk),
|
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)]
|
#[derive(Debug)]
|
||||||
pub struct TitleNeedsDb<'a> {
|
pub struct TitleNeedsDb<'a> {
|
||||||
kind: &'a TimelineKind,
|
kind: &'a TimelineKind,
|
||||||
|
|||||||
Reference in New Issue
Block a user