notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit f786d0568da3ab8cd5ec83366ab2eda5f551f6fa
parent 74ce87049d50239fe5e228bf8afde8752cc01678
Author: William Casarin <jb55@jb55.com>
Date:   Wed,  7 Feb 2024 15:46:06 -0800

subs: switch to multiple-filter style

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
MCargo.lock | 2+-
MCargo.toml | 2+-
Msrc/app.rs | 12++++++++----
3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -2468,7 +2468,7 @@ dependencies = [ [[package]] name = "nostrdb" version = "0.1.6" -source = "git+https://github.com/damus-io/nostrdb-rs?rev=07c64d6f9956c3898ed0555c38aa5ed5bd482cd2#07c64d6f9956c3898ed0555c38aa5ed5bd482cd2" +source = "git+https://github.com/damus-io/nostrdb-rs?rev=a8f8fabdc2f1eebe939622000c030639b4b6d51f#a8f8fabdc2f1eebe939622000c030639b4b6d51f" dependencies = [ "bindgen", "cc", diff --git a/Cargo.toml b/Cargo.toml @@ -30,7 +30,7 @@ env_logger = "0.10.0" shatter = "0.1.1" puffin_egui = { version = "0.25.0", optional = true } puffin = { version = "0.16.0", optional = true } -nostrdb = { git = "https://github.com/damus-io/nostrdb-rs", rev = "07c64d6f9956c3898ed0555c38aa5ed5bd482cd2" } +nostrdb = { git = "https://github.com/damus-io/nostrdb-rs", rev = "a8f8fabdc2f1eebe939622000c030639b4b6d51f" } [features] default = [] diff --git a/src/app.rs b/src/app.rs @@ -153,9 +153,11 @@ fn try_process_event(damus: &mut Damus, ctx: &egui::Context) { // do we have any new processed events? if let Some(ref sub) = damus.home_sub { - let new_notes = damus.ndb.poll_for_notes(sub, 50); - if new_notes.len() > 0 { - info!("{} new notes! {:?}", new_notes.len(), new_notes); + let new_note_ids = damus.ndb.poll_for_notes(sub, 100); + if new_note_ids.len() > 0 { + info!("{} new notes! {:?}", new_note_ids.len(), new_note_ids); + + for note in new_note_ids {} } } } @@ -167,7 +169,9 @@ fn setup_profiling() { fn setup_initial_nostrdb_subs(damus: &mut Damus) -> Result<()> { let filter: nostrdb::Filter = crate::filter::convert_enostr_filter(&get_home_filter()); - damus.home_sub = Some(damus.ndb.subscribe(filter)?); + damus.home_sub = Some(damus.ndb.subscribe(vec![filter])?); + //damus.ndb.query() + Ok(()) }