mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-25 01:59:08 -05:00
fix: send EOSE when ids list is empty in subscriptions
Fixes: https://todo.sr.ht/~gheartsfield/nostr-rs-relay/50
This commit is contained in:
parent
4de7490d97
commit
5fa24bc9f1
12
src/db.rs
12
src/db.rs
|
@ -435,7 +435,7 @@ fn query_from_filter(f: &ReqFilter) -> (String, Vec<Box<dyn ToSql>>) {
|
||||||
return (empty_query, empty_params);
|
return (empty_query, empty_params);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut query = "SELECT DISTINCT(e.content), e.created_at FROM event e ".to_owned();
|
let mut query = "SELECT DISTINCT(e.content), e.created_at FROM event e".to_owned();
|
||||||
// query parameters for SQLite
|
// query parameters for SQLite
|
||||||
let mut params: Vec<Box<dyn ToSql>> = vec![];
|
let mut params: Vec<Box<dyn ToSql>> = vec![];
|
||||||
|
|
||||||
|
@ -511,8 +511,14 @@ fn query_from_filter(f: &ReqFilter) -> (String, Vec<Box<dyn ToSql>>) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let id_clause = format!("({})", id_searches.join(" OR "));
|
if idvec.len() > 0 {
|
||||||
filter_components.push(id_clause);
|
let id_clause = format!("({})", id_searches.join(" OR "));
|
||||||
|
filter_components.push(id_clause);
|
||||||
|
} else {
|
||||||
|
// if the ids list was empty, we should never return
|
||||||
|
// any results.
|
||||||
|
filter_components.push("false".to_owned());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Query for tags
|
// Query for tags
|
||||||
if let Some(map) = &f.tags {
|
if let Some(map) = &f.tags {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user