Don't subscribe to events we don't need (2 places)

This commit is contained in:
Mike Dilger 2023-01-12 02:38:31 +13:00
parent a90e0c0861
commit 88da5b8bb9

View File

@ -480,14 +480,21 @@ impl Minion {
} }
} }
} }
// Get ancestors we know of
filters.push(Filter { filters.push(Filter {
ids: ids.clone(), ids: ids.clone(),
..Default::default() ..Default::default()
}); });
// Replies and reactions to this post and ancestors // Replies and reactions to ancestors
filters.push(Filter { filters.push(Filter {
e: ids, e: ids,
kinds: vec![
EventKind::TextNote,
EventKind::Reaction,
EventKind::EventDeletion,
],
since: Some(Unixtime::now().unwrap() - Duration::from_secs(feed_chunk)), since: Some(Unixtime::now().unwrap() - Duration::from_secs(feed_chunk)),
..Default::default() ..Default::default()
}); });
@ -653,7 +660,7 @@ impl Minion {
let handle = format!("temp_subscribe_metadata_{}", &pubkeyhex.0); let handle = format!("temp_subscribe_metadata_{}", &pubkeyhex.0);
let filter = Filter { let filter = Filter {
authors: vec![pubkeyhex], authors: vec![pubkeyhex],
kinds: vec![EventKind::Metadata, EventKind::ContactList], kinds: vec![EventKind::Metadata],
// FIXME: we could probably get a since-last-fetched-their-metadata here. // FIXME: we could probably get a since-last-fetched-their-metadata here.
// but relays should just return the lastest of these. // but relays should just return the lastest of these.
..Default::default() ..Default::default()