LOCAL RELAY MODEL IS WORKING

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-02-09 16:59:49 -08:00
parent 4a9af5561a
commit f323fe7379
7 changed files with 204 additions and 149 deletions

View File

@@ -6,7 +6,7 @@ pub fn convert_enostr_filter(filter: &enostr::Filter) -> nostrdb::Filter {
}
if let Some(ref authors) = filter.authors {
let authors: Vec<[u8; 32]> = authors.iter().map(|a| a.bytes()).collect();
let authors: Vec<[u8; 32]> = authors.iter().map(|a| *a.bytes()).collect();
nfilter.authors(authors);
}
@@ -21,7 +21,7 @@ pub fn convert_enostr_filter(filter: &enostr::Filter) -> nostrdb::Filter {
// #p
if let Some(ref pubkeys) = filter.pubkeys {
nfilter.pubkeys(pubkeys.iter().map(|a| a.bytes()).collect());
nfilter.pubkeys(pubkeys.iter().map(|a| *a.bytes()).collect());
}
if let Some(since) = filter.since {
@@ -32,5 +32,5 @@ pub fn convert_enostr_filter(filter: &enostr::Filter) -> nostrdb::Filter {
nfilter.limit(limit.into());
}
nfilter
nfilter.build()
}