fetch contact lists

If we don't have a contact list, make sure to fetch one

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-08-31 11:47:09 -07:00
parent 92e9e34e19
commit ad244d48c0
15 changed files with 517 additions and 194 deletions

23
src/subscriptions.rs Normal file
View File

@@ -0,0 +1,23 @@
use std::collections::HashMap;
pub enum SubKind {
/// Initial subscription. This is the first time we do a remote subscription
/// for a timeline
Initial,
/// One shot requests, we can just close after we receive EOSE
OneShot,
/// We are fetching a contact list so that we can use it for our follows
/// Filter.
// TODO: generalize this to any list?
FetchingContactList(u32),
}
/// Subscriptions that need to be tracked at various stages. Sometimes we
/// need to do A, then B, then C. Tracking requests at various stages by
/// mapping uuid subids to explicit states happens here.
#[derive(Default)]
pub struct Subscriptions {
pub subs: HashMap<String, SubKind>,
}