subs: switch to multiple-filter style
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -2468,7 +2468,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "nostrdb"
|
name = "nostrdb"
|
||||||
version = "0.1.6"
|
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 = [
|
dependencies = [
|
||||||
"bindgen",
|
"bindgen",
|
||||||
"cc",
|
"cc",
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ env_logger = "0.10.0"
|
|||||||
shatter = "0.1.1"
|
shatter = "0.1.1"
|
||||||
puffin_egui = { version = "0.25.0", optional = true }
|
puffin_egui = { version = "0.25.0", optional = true }
|
||||||
puffin = { version = "0.16.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]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|||||||
12
src/app.rs
12
src/app.rs
@@ -153,9 +153,11 @@ fn try_process_event(damus: &mut Damus, ctx: &egui::Context) {
|
|||||||
|
|
||||||
// do we have any new processed events?
|
// do we have any new processed events?
|
||||||
if let Some(ref sub) = damus.home_sub {
|
if let Some(ref sub) = damus.home_sub {
|
||||||
let new_notes = damus.ndb.poll_for_notes(sub, 50);
|
let new_note_ids = damus.ndb.poll_for_notes(sub, 100);
|
||||||
if new_notes.len() > 0 {
|
if new_note_ids.len() > 0 {
|
||||||
info!("{} new notes! {:?}", new_notes.len(), new_notes);
|
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<()> {
|
fn setup_initial_nostrdb_subs(damus: &mut Damus) -> Result<()> {
|
||||||
let filter: nostrdb::Filter = crate::filter::convert_enostr_filter(&get_home_filter());
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user