diff --git a/src/db.rs b/src/db.rs index cbc0172..a4fabc6 100644 --- a/src/db.rs +++ b/src/db.rs @@ -575,6 +575,12 @@ pub async fn db_query( }) .ok(); } + query_tx + .blocking_send(QueryResult { + sub_id: sub.get_id(), + event: "EOSE".to_string(), + }) + .ok(); debug!( "query completed ({} rows) in {:?}", row_count, diff --git a/src/info.rs b/src/info.rs index d1d8d7e..143d5d9 100644 --- a/src/info.rs +++ b/src/info.rs @@ -35,7 +35,7 @@ impl From for RelayInfo { description: i.description, pubkey: i.pubkey, contact: i.contact, - supported_nips: Some(vec![1, 2, 11]), + supported_nips: Some(vec![1, 2, 11, 15]), software: Some("https://git.sr.ht/~gheartsfield/nostr-rs-relay".to_owned()), version: CARGO_PKG_VERSION.map(|x| x.to_owned()), } diff --git a/src/main.rs b/src/main.rs index 449937c..34f0043 100644 --- a/src/main.rs +++ b/src/main.rs @@ -424,11 +424,16 @@ async fn nostr_server( }, Some(query_result) = query_rx.recv() => { // database informed us of a query result we asked for - client_received_event_count += 1; - // send a result let subesc = query_result.sub_id.replace("\"", ""); - let send_str = format!("[\"EVENT\",\"{}\",{}]", subesc, &query_result.event); - ws_stream.send(Message::Text(send_str)).await.ok(); + if query_result.event == "EOSE" { + let send_str = format!("[\"EOSE\",\"{}\"]", subesc); + ws_stream.send(Message::Text(send_str)).await.ok(); + } else { + client_received_event_count += 1; + // send a result + let send_str = format!("[\"EVENT\",\"{}\",{}]", subesc, &query_result.event); + ws_stream.send(Message::Text(send_str)).await.ok(); + } }, // TODO: consider logging the LaggedRecv error Ok(global_event) = bcast_rx.recv() => {