prop UnknownIds for initial timeline
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -155,6 +155,7 @@ fn try_process_event(
|
|||||||
app_ctx.note_cache,
|
app_ctx.note_cache,
|
||||||
timeline,
|
timeline,
|
||||||
app_ctx.accounts,
|
app_ctx.accounts,
|
||||||
|
app_ctx.unknown_ids,
|
||||||
);
|
);
|
||||||
|
|
||||||
if is_ready {
|
if is_ready {
|
||||||
@@ -222,6 +223,7 @@ fn update_damus(damus: &mut Damus, app_ctx: &mut AppContext<'_>, ctx: &egui::Con
|
|||||||
app_ctx.ndb,
|
app_ctx.ndb,
|
||||||
app_ctx.note_cache,
|
app_ctx.note_cache,
|
||||||
&mut damus.timeline_cache,
|
&mut damus.timeline_cache,
|
||||||
|
app_ctx.unknown_ids,
|
||||||
) {
|
) {
|
||||||
warn!("update_damus init: {err}");
|
warn!("update_damus init: {err}");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -471,10 +471,11 @@ pub fn setup_new_timeline(
|
|||||||
note_cache: &mut NoteCache,
|
note_cache: &mut NoteCache,
|
||||||
since_optimize: bool,
|
since_optimize: bool,
|
||||||
accounts: &Accounts,
|
accounts: &Accounts,
|
||||||
|
unknown_ids: &mut UnknownIds,
|
||||||
) {
|
) {
|
||||||
// if we're ready, setup local subs
|
// if we're ready, setup local subs
|
||||||
if is_timeline_ready(ndb, pool, note_cache, timeline, accounts) {
|
if is_timeline_ready(ndb, pool, note_cache, timeline, accounts, unknown_ids) {
|
||||||
if let Err(err) = setup_timeline_nostrdb_sub(ndb, txn, note_cache, timeline) {
|
if let Err(err) = setup_timeline_nostrdb_sub(ndb, txn, note_cache, timeline, unknown_ids) {
|
||||||
error!("setup_new_timeline: {err}");
|
error!("setup_new_timeline: {err}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -608,6 +609,7 @@ fn setup_initial_timeline(
|
|||||||
txn: &Transaction,
|
txn: &Transaction,
|
||||||
timeline: &mut Timeline,
|
timeline: &mut Timeline,
|
||||||
note_cache: &mut NoteCache,
|
note_cache: &mut NoteCache,
|
||||||
|
unknown_ids: &mut UnknownIds,
|
||||||
filters: &HybridFilter,
|
filters: &HybridFilter,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
// some timelines are one-shot and a refreshed, like last_per_pubkey algo feed
|
// some timelines are one-shot and a refreshed, like last_per_pubkey algo feed
|
||||||
@@ -642,10 +644,11 @@ pub fn setup_initial_nostrdb_subs(
|
|||||||
ndb: &Ndb,
|
ndb: &Ndb,
|
||||||
note_cache: &mut NoteCache,
|
note_cache: &mut NoteCache,
|
||||||
timeline_cache: &mut TimelineCache,
|
timeline_cache: &mut TimelineCache,
|
||||||
|
unknown_ids: &mut UnknownIds,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
for (_kind, timeline) in timeline_cache {
|
for (_kind, timeline) in timeline_cache {
|
||||||
let txn = Transaction::new(ndb).expect("txn");
|
let txn = Transaction::new(ndb).expect("txn");
|
||||||
if let Err(err) = setup_timeline_nostrdb_sub(ndb, &txn, note_cache, timeline) {
|
if let Err(err) = setup_timeline_nostrdb_sub(ndb, &txn, note_cache, timeline, unknown_ids) {
|
||||||
error!("setup_initial_nostrdb_subs: {err}");
|
error!("setup_initial_nostrdb_subs: {err}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -658,6 +661,7 @@ fn setup_timeline_nostrdb_sub(
|
|||||||
txn: &Transaction,
|
txn: &Transaction,
|
||||||
note_cache: &mut NoteCache,
|
note_cache: &mut NoteCache,
|
||||||
timeline: &mut Timeline,
|
timeline: &mut Timeline,
|
||||||
|
unknown_ids: &mut UnknownIds,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let filter_state = timeline
|
let filter_state = timeline
|
||||||
.filter
|
.filter
|
||||||
@@ -665,7 +669,7 @@ fn setup_timeline_nostrdb_sub(
|
|||||||
.ok_or(Error::App(notedeck::Error::empty_contact_list()))?
|
.ok_or(Error::App(notedeck::Error::empty_contact_list()))?
|
||||||
.to_owned();
|
.to_owned();
|
||||||
|
|
||||||
setup_initial_timeline(ndb, txn, timeline, note_cache, &filter_state)?;
|
setup_initial_timeline(ndb, txn, timeline, note_cache, unknown_ids, &filter_state)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -680,6 +684,7 @@ pub fn is_timeline_ready(
|
|||||||
note_cache: &mut NoteCache,
|
note_cache: &mut NoteCache,
|
||||||
timeline: &mut Timeline,
|
timeline: &mut Timeline,
|
||||||
accounts: &Accounts,
|
accounts: &Accounts,
|
||||||
|
unknown_ids: &mut UnknownIds,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
// TODO: we should debounce the filter states a bit to make sure we have
|
// TODO: we should debounce the filter states a bit to make sure we have
|
||||||
// seen all of the different contact lists from each relay
|
// seen all of the different contact lists from each relay
|
||||||
@@ -753,7 +758,8 @@ pub fn is_timeline_ready(
|
|||||||
// queries and setup the local subscription
|
// queries and setup the local subscription
|
||||||
info!("Found contact list! Setting up local and remote contact list query");
|
info!("Found contact list! Setting up local and remote contact list query");
|
||||||
let txn = Transaction::new(ndb).expect("txn");
|
let txn = Transaction::new(ndb).expect("txn");
|
||||||
setup_initial_timeline(ndb, &txn, timeline, note_cache, &filter).expect("setup init");
|
setup_initial_timeline(ndb, &txn, timeline, note_cache, unknown_ids, &filter)
|
||||||
|
.expect("setup init");
|
||||||
timeline
|
timeline
|
||||||
.filter
|
.filter
|
||||||
.set_relay_state(relay_id, FilterState::ready_hybrid(filter.clone()));
|
.set_relay_state(relay_id, FilterState::ready_hybrid(filter.clone()));
|
||||||
|
|||||||
@@ -709,6 +709,7 @@ pub fn render_add_column_routes(
|
|||||||
ctx.note_cache,
|
ctx.note_cache,
|
||||||
app.options.contains(AppOptions::SinceOptimize),
|
app.options.contains(AppOptions::SinceOptimize),
|
||||||
ctx.accounts,
|
ctx.accounts,
|
||||||
|
ctx.unknown_ids,
|
||||||
);
|
);
|
||||||
|
|
||||||
app.columns_mut(ctx.i18n, ctx.accounts)
|
app.columns_mut(ctx.i18n, ctx.accounts)
|
||||||
@@ -749,6 +750,7 @@ pub fn render_add_column_routes(
|
|||||||
ctx.note_cache,
|
ctx.note_cache,
|
||||||
app.options.contains(AppOptions::SinceOptimize),
|
app.options.contains(AppOptions::SinceOptimize),
|
||||||
ctx.accounts,
|
ctx.accounts,
|
||||||
|
ctx.unknown_ids,
|
||||||
);
|
);
|
||||||
|
|
||||||
app.columns_mut(ctx.i18n, ctx.accounts)
|
app.columns_mut(ctx.i18n, ctx.accounts)
|
||||||
|
|||||||
Reference in New Issue
Block a user